获取没有唯一数据的证书指纹
Getting certificate thumbprint with no unique data
我正在使用以下 powershell 搜索为用户帐户获取 3 个证书指纹。
get-childitem -path $certPath | where-object {$_.Subject -match "$Displayname"} | Where-Object {$_.EnhancedKeyUsageList -match "EKU OID"}
其中两个证书具有增强型密钥用法,我可以轻松搜索到。其中一个证书没有增强型密钥用法。我尝试了各种比较来搜索空值,但我的所有搜索 return 其他两个证书。我试过 -match、-notmatch、-like 和 -notlike。关于如何挑选此证书的任何建议?
我能够通过使用以下搜索参数获得证书
Get-ChildItem cert:\my\ |Where-Object{
($TmplExt = $_.Extensions |Where-Object {
$_.Oid.FriendlyName -match 'Certificate Template'}) -and
$TmplExt.format(0) -match 'MyTemplateName'}
我从这个 post 中找到了示例:How can I delete certificate that has specific template?
我正在使用以下 powershell 搜索为用户帐户获取 3 个证书指纹。
get-childitem -path $certPath | where-object {$_.Subject -match "$Displayname"} | Where-Object {$_.EnhancedKeyUsageList -match "EKU OID"}
其中两个证书具有增强型密钥用法,我可以轻松搜索到。其中一个证书没有增强型密钥用法。我尝试了各种比较来搜索空值,但我的所有搜索 return 其他两个证书。我试过 -match、-notmatch、-like 和 -notlike。关于如何挑选此证书的任何建议?
我能够通过使用以下搜索参数获得证书
Get-ChildItem cert:\my\ |Where-Object{
($TmplExt = $_.Extensions |Where-Object {
$_.Oid.FriendlyName -match 'Certificate Template'}) -and
$TmplExt.format(0) -match 'MyTemplateName'}
我从这个 post 中找到了示例:How can I delete certificate that has specific template?