Windows根证书的批量导出和导入


# POWERSHELL批量导出
Get-ChildItem -Path Cert:\LocalMachine\Root\ |ForEach-Object {Export-Certificate -Cert $_ -FilePath ($env:USERPROFILE + "\Desktop\新建文件夹\ROOT\" + $_.Thumbprint + ".cer")}

# POWERSHELL批量导入
Get-ChildItem -Path ($env:USERPROFILE + "\Desktop\新建文件夹\ROOT\") |Import-Certificate -CertStoreLocation cert:\CurrentUser\Root

 

rem 命令行批量导入

@echo off
cd /d %~dp0
for /f "tokens=*" %%G in ('dir *.crt /b ') do Certutil -f -addstore Root %%G

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM