如何使用 PowerShell 将证书安装到证书存储?
要使用PowerShell安装证书,我们需要使用Import-Certificate命令。例如,我们有一个证书存储在C:\temp\Mycert.cer位置,我们需要将它安装在本地机器的个人存储中。
示例
Import-Certificate -FilePath C:\Temp\Mycert.cer ` -CertStoreLocation Cert:\LocalMachine\My\
您也可以使用以下方法。
PS C:\> Set-Location Cert:\LocalMachine\My\ PS Cert:\LocalMachine\My\> Import-Certificate -FilePath C:\Temp\Mycert.cer
要在远程计算机上安装证书,请使用Invoke-Command方法。
语法
Invoke-Command -ComputerName RemoteServer1 -ScriptBlock {Import-Certificate -FilePath C:\Temp\Mycert.cer `
-CertStoreLocation Cert:\LocalMachine\My\ }上面的命令会在RemoteServer1 上安装证书,从远程服务器的C:\temp路径到远程机器的个人存储。
热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下