powershellcertificate

Install certificate with PowerShell on remote server


I want to install a certificate (X.509) created with makecert.exe on a remote server. I am not able to use psexec or something like that but have to use PowerShell.

Question: How to install a certificate with PowerShell on a remote server.


Solution

  • To import a PFX file you can use Import-PfxCertificate, for example

    Import-PfxCertificate -FilePath YOUR_PFX_FILE.pfx -Password (ConvertTo-SecureString -String "THE_PFX_PASSWORD" -AsPlainText -Force)
    

    To do this on a remote computer, you can use Invoke-Command -ComputerName (and use an UNC path for the PFX file).