Tuesday, December 07, 2010

Powershell: Find certificate by thumbprint

cd cert:
dir -recurse | where {$_.Thumbprint -eq "84e2c011ad0c1b3f6d32f651069bba184c426158"} | Format-List -property *

4 comments:

ErrorTM said...

Worked like a charm, thanks.

Unknown said...

Get-ChildItem -path cert:\LocalMachine\My | where {$_.Thumbprint -eq "84e2c011ad0c1b3f6d32f651069bba184c426158"}

Pekko said...

Thanks Bart, your script works & is simpler! :)

%1's %2 said...

If you're having a hard time finding a cert by thumbprint on a host system, and you are also the PKI administrator for an ADCS deployment, you can also search the CA database in the Cert Manager UI by going to the View menu item and selecting 'Add/Remove Columns', then adding the 'Certificate Hash' column to the view. This will allow you to match any thumbprint to the one you're looking for, and to export the cert to which it belongs to wherever it's missing.