我怀疑以下内容不是直接您正在寻找的内容,但也许它最终包含您正在寻找的信息;它基于将Get-ChildItem 应用于PowerShell 的Cert: 驱动器:
Get-ChildItem Cert:\LocalMachine -Recurse |
Where-Object { -not $_.PSIsContainer -and $_.EnhancedKeyUsageList }
Format-List @{
Name='KeyUsage'
Expression={ ($_.EnhancedKeyUsageList.FriendlyName) -join ', ' }
},
Subject,
Thumbprint
注意:Windows PowerShell 和 PowerShell (Core) 7.1 之间的行为在默认输出格式和报告非空 @ 的证书数量方面都发生了变化987654325@ 属性值:Windows PowerShell 报告更多。
在 PowerShell (Core) 7.1 中,上面的结果类似于:
KeyUsage : Code Signing, Time Stamping, Encrypting File System
Subject : CN=UTN-USERFirst-Object, OU=http://www.usertrust.com, O=The USERTRUST Network, L=Salt Lake City, S=UT, C=US
Thumbprint : 6E6D0A31B454AF8E8F06CFEB438351056204C28C
KeyUsage : Server Authentication, Client Authentication, ,
Subject : OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign International Server CA - Class 3, OU="VeriSign, Inc.", O=VeriSign Trust Network
Thumbprint : 13E8AB4167D5830F9440093564AC0211C2D26E62
KeyUsage : Code Signing, Windows Hardware Driver Verification
Subject : CN=Microsoft Windows Hardware Compatibility, OU=Microsoft Corporation, OU=Microsoft Windows Hardware Compatibility Intermediate CA, OU=Copyright (c) 1997 Microsoft Corp.
Thumbprint : 75F7C7CDC6900B145CF9242910EC037D423F369F
KeyUsage : Code Signing, Time Stamping, Encrypting File System
Subject : CN=UTN-USERFirst-Object, OU=http://www.usertrust.com, O=The USERTRUST Network, L=Salt Lake City, S=UT, C=US
Thumbprint : 59E6BAC5EFE4C1A11B889146BD983F468C5103BA
KeyUsage : Server Authentication
Subject : CN=localhost
Thumbprint : 81F6D78B7A53AE3D03264D178A2E0FEBC978C4D8