Friday, March 10, 2017

How to list certificate installed on my PC using PowerShell.

Use the below code to get the list of certificate installed .

This code gets the children of “Cert:\LocalMachine\my ” , adds the same to an array

$certificates = @{}
Get-ChildItem Cert:\LocalMachine\my | % {
        $cert = $_
        $_.DnsNameList | % {
   
            [string] $dnsName = $_
            $certificates[$dnsName] = $cert.Thumbprint
        }
    }

 $certificates

No comments:

Post a Comment