I have created a machine certificate. It appears in the Certificates (Local Computer)\Personal\Certificates certificate repository folder. Now I wish to extract its thumbprint using a command line utility.
Unfortunately, the closest thing that I could find is in this article.
I need to be able to perform this procedure on any Windows OS starting with XP.
Thanks.
Double-click the certificate. In the Certificate dialog box, click the Details tab. Scroll through the list of fields and click Thumbprint. Copy the hexadecimal characters from the box.
Right-click on the certificate file and choose Find Certificates dialog. Use the dialog to locate the certificate file from your provider. When the Certificate dialog displays, Click the Details tab. Locate and select the Thumbprint field to display the thumbprint from your certificate.
To get the certificate thumbprint using PowerShell is very much easy. We just need to retrieve the path where certificates reside and the default property that is shown on the console will include the certificate thumbprint. For example, we are going to retrieve the certificate from the personal store.
Old, but maybe this will help someone. Put the following in a powershell script(.ps1) and run it. It will print the thumb to the screen. watch the word wrap in my paste.
$computerName = $Env:Computername
$domainName = $Env:UserDnsDomain
write-host "CN=$computername.$domainname"
$getThumb = Get-ChildItem -path cert:\LocalMachine\My | where { $_.Subject -match "CN\=$Computername\.$DomainName" }
$getThumb.thumbprint
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With