Install certificate with PowerShell on remote server

前端 未结 2 1660
清歌不尽
清歌不尽 2021-01-03 02:44

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.

2条回答
  •  半阙折子戏
    2021-01-03 03:19

    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).

提交回复
热议问题