在远程服务器上使用PowerShell安装证书 [英] Install certificate with PowerShell on remote server
本文介绍了在远程服务器上使用PowerShell安装证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要在远程服务器上安装使用makecert.exe创建的证书(X.509)。我不能使用psexec或类似的东西,但必须使用PowerShell。
- 服务器操作系统:Windows Server 2008 R2
- PowerShell版本:4
$ b $ p问题:如何使用PowerShell在远程安装证书
解决方案
要导入PFX文件,您可以使用 Import-PfxCertificate
,例如
Import-PfxCertificate -FilePath YOUR_PFX_FILE.pfx -Password(ConvertTo-SecureString-StringTHE_PFX_PASSWORD-AsPlainText -Force)
$ c $要在远程计算机上执行此操作,您可以使用
library / hh849719.aspxrel =nofollow> Invoke-Command -ComputerName
(并为PFX文件使用UNC路径)。
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.
- Server operating system: Windows Server 2008 R2
- PowerShell version: 4
Question: How to install a certificate with PowerShell on a remote server.
解决方案 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).
这篇关于在远程服务器上使用PowerShell安装证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文