Difference between revisions of "Powershell certs"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 +
```
 +
$session = New-PSSession -ComputerName $computerName
 +
Copy-Item -Path $CertPath -ToSession $session -Destination 'c:\windows\temp\test.pfx'
 +
 +
Invoke-Command -Session $session -ScriptBlock {
 +
    Import-PFXCertificate -CertStoreLocation Cert:\LocalMachine\My -FilePath 'c:\windows\temp\test.pfx' -Password $using:CertPass
 +
}
 +
Remove-PSSession $session
 +
 +
```
 +
 +
 
https://social.technet.microsoft.com/Forums/en-US/2eda9d44-aeb3-47cb-942a-cb41306091ba/import-pfx-certificate-on-remote-computers-with-script?forum=winserverpowershell
 
https://social.technet.microsoft.com/Forums/en-US/2eda9d44-aeb3-47cb-942a-cb41306091ba/import-pfx-certificate-on-remote-computers-with-script?forum=winserverpowershell
  

Latest revision as of 01:44, 28 June 2022