Как импортировать сертификат для компьютера в личное (personal\my) хранилище сертификатов.
Задача сделать импорт pfx сертификата в личное хранилище \LocalMachine\My
Сделал gpo task scheduled
Program
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Argument:
-ExecutionPolicy Bypass -File "\\путь\Install-Certificate.ps1"
Сам Install-Certificate.ps1
# Computer name $computerName = $env:COMPUTERNAME # Start transcript logging Write-Output "# Start transcript logging" Start-Transcript -Path "\\путь\transcript_$computerName.txt" -Force # Path to the certificate file $certPath = "\\путь\Certificate_Deployment\pc.pfx" #$password = "пароль" #[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($password)) # Encoded password in Base64 $encodedPassword = "пароль" # This is "пароль" encoded in Base64 # Decode the password from Base64 and convert it to a secure string $passwordBytes = [System.Convert]::FromBase64String($encodedPassword) $passwordPlainText = [System.Text.Encoding]::UTF8.GetString($passwordBytes) $password = $passwordPlainText | ConvertTo-SecureString -AsPlainText -Force # Task name in… Читать далее



