Home » General Scripting and Coding » PowerShell » List Certificates for Local Machine and Current User

List Certificates for Local Machine and Current User

Posted on by

This is a quick PowerShell script that I knocked up to list all certificates and their location (local machine or current user and the certificate store).  You can tweak it where required.

get-childitem -Path Cert:\ | foreach-object ({
    $location = $_.Location
    foreach($store in $_.StoreNames.Keys) {         
        get-childitem -Path "Cert:\$location\$store" | foreach-object ({
            $thumb = $($_.ThumbPrint)
            $issuer = $($_.Issuer)          
            write-host "$location $store $issuer"
        })
    }
}) 
Comments have now been disabled. If you have a question to ask about this post please ask the community!