Windows根证书的批量导出和导入
2021-06-08 05:02
标签:for reac obj env 根证书 use code current top Windows根证书的批量导出和导入 标签:for reac obj env 根证书 use code current top 原文地址:https://www.cnblogs.com/waxwork3/p/10703938.html# 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