Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a command line utility to extract the certificate thumbprint?

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.

like image 328
mark Avatar asked Dec 27 '10 18:12

mark


People also ask

How do I extract a thumbprint certificate?

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.

How do I find the thumbprint of a certificate server?

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.

How do I get the thumbprint of a certificate in PowerShell?

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.


1 Answers

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
like image 134
Paul Avatar answered Nov 15 '22 19:11

Paul