인증서를 검색하려면 기본적으로 인증서 공급자가 원격 컴퓨터 연결을 노출하지 않으므로 기본 .NET 클래스를 사용합니다. 추신 : PS 리모팅으로 다른 가능성을 발견 할 수도 있습니다. 여기에 기능입니다 :
function Get-Certificates {
Param(
$Computer = $env:COMPUTERNAME,
[System.Security.Cryptography.X509Certificates.StoreLocation]$StoreLocation,
[System.Security.Cryptography.X509Certificates.StoreName]$StoreName
)
$Store = New-Object System.Security.Cryptography.X509Certificates.X509Store("\\$computer\$StoreName",$StoreLocation)
$Store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadOnly")
$Store.Certificates
}
그리고 여기에 두 개의 목록을 비교하는 데 사용하는 것이 방법입니다
$Left = Get-Certificates -StoreLocation LocalMachine -StoreName Root
$Right = Get-Certificates -StoreLocation LocalMachine -StoreName Root -Computer "REMOTE-PC"
# Dump to console
Compare-Object $Left $Right -property Thumbprint, FriendlyName, Subject, NotAfter | Format-Table
# Export results to file
Compare-Object $Left $Right -property Thumbprint, FriendlyName, Subject, NotAfter | Export-Csv Comparison.csv
당신이 시도 무엇을, 어떤 문제가 당신이 도움을 필요가 발생 했습니까? –
위의 명령을 사용하여 certs 목록을 얻을 수 있지만 문제가있는 것은 하나의 스크립트에서이 모든 작업을 시도하는 것입니다. 한 서버에서 certs 목록을 얻은 다음 다른 서버에서 certs 목록을 가져 와서 두 목록을 비교하고 싶습니다. Powershell을 처음 접했을 때 나는 어디서부터 시작해야할지 모르겠다. – tdean
시작 [여기] (http://blogs.msdn.com/b/timid/archive/2009/10/07/powershell-for-non-n00bs-certificates-installed-on-a-remote-host.aspx) . –