Ssl 使用“System.Security.Cryptography.X509Certificates”从证书检索颁发者指纹

Ssl 使用“System.Security.Cryptography.X509Certificates”从证书检索颁发者指纹,ssl,certificate,powershell-3.0,Ssl,Certificate,Powershell 3.0,如果我使用System.Security.Cryptography.X509Certificates,是否可以从powershell脚本中的证书检索颁发者指纹 我有一个powershell脚本,它在远程服务器上获取我的存储中的所有证书,然后将其输出到一个格式表。我想知道什么是发行人的指纹与相同的脚本 Param( [parameter( Mandatory=$true)] [String]$CSVFile ) Set-ExecutionPolicy RemoteSig

如果我使用System.Security.Cryptography.X509Certificates,是否可以从powershell脚本中的证书检索颁发者指纹

我有一个powershell脚本,它在远程服务器上获取我的存储中的所有证书,然后将其输出到一个格式表。我想知道什么是发行人的指纹与相同的脚本

Param(

    [parameter(
    Mandatory=$true)]
    [String]$CSVFile
)

Set-ExecutionPolicy RemoteSigned

$Serveurs = import-csv $CSVFile
$Nom = $Serveurs.Nom

Foreach ($Serveur in $Serveurs){
        $x509store = new-object System.Security.Cryptography.X509Certificates.X509Store("\\$($Serveur.Nom)\My","LocalMachine")
        $x509store.Open('ReadOnly')
        $x509store.Certificates | Format-Table -Property FriendlyName,NotAfter,Thumbprint,Issuer,Subject
}

谢谢

我建议您使用powershell为您的证书存储提供的psdrive

Get-ChildItem -Path Cert:\LocalMachine\My | 
Format-Table -Property FriendlyName,NotAfter,Thumbprint,Issuer,Subject
更新: 我没有注意到这是一个远程机器。您可以在Invoke命令中rap该cmd

Invoke-Command -ComputerName "Computer1","Computer2",... -ScriptBlock {Get-ChildItem -Path Cert:\LocalMachine\My}

我认为这并不能回答所问的问题。返回的指纹是证书本身的指纹,而不是颁发者的指纹。