是否有命令行实用程序来提取证书指纹? [英] 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.
我需要能够在以XP开头的任何Windows操作系统上执行此过程。
I need to be able to perform this procedure on any Windows OS starting with XP.
谢谢。
推荐答案
旧的,但这也许会对某人有所帮助。将以下内容放入Powershell脚本(.ps1)中并运行它。它将拇指打印到屏幕上。
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
这篇关于是否有命令行实用程序来提取证书指纹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!