亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Powershell實(shí)現(xiàn)導(dǎo)入安裝證書功能腳本分享

 更新時(shí)間:2014年11月07日 08:53:50   投稿:junjie  
這篇文章主要介紹了Powershell實(shí)現(xiàn)導(dǎo)入安裝證書功能腳本分享,本文用編程方法實(shí)現(xiàn)把pfx證書文件導(dǎo)入到指定的庫中,需要的朋友可以參考下

支持所有版本。
通常從文件加載一個(gè)證書并且安裝它到指定的庫??梢允褂孟旅娴哪_本:

復(fù)制代碼 代碼如下:

$pfxpath = 'C:\temp\test.pfx'
$password = 'test'
[System.Security.Cryptography.X509Certificates.StoreLocation]$Store = 'CurrentUser'
$StoreName = 'root'
 
Add-Type -AssemblyName System.Security
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$certificate.Import($pfxpath, $password, 'Exportable')
 
$Store = New-Object system.security.cryptography.X509Certificates.x509Store($StoreName, $StoreLocation)
$Store.Open('ReadWrite')
$Store.Add($certificate)
$Store.Close()

現(xiàn)在你可以配置這個(gè)腳本,指定證書的位置和密碼。你還可以指定存儲(chǔ)位置(當(dāng)前用戶或本地計(jì)算機(jī))并添加證書(例如被信任的根證書)或私有證書。

相關(guān)文章

最新評論