我想从我的系统中获取所有证书。因此,当我在X509Store
之后删除()
时,我使用了System.Security.Cryptography.X509Certificates class.
,得到了与输入"My"
相同的结果
查看所有证书的正确成员名是什么?有可能吗?
MSDN StoreName Enumeration
$store=new-object System.Security.Cryptography.X509Certificates.X509Store("CA")
# Put in CA, My, root etc.
$store.open("ReadOnly")
$store.Certificates
$store.Certificates.count
4条答案
按热度按时间yqhsw0fo1#
您可以从本地证书驱动器获取它们:
nbysray52#
如果您安装了WinRM,这会很有趣,但以一种更标准的方式来查找所有证书,最好使用如下内容
qpgpyjmq3#
以下PowerShell脚本将要求提供远程计算机的DNS名称,然后要求提供域管理员凭据,以便可以连接和查询。生成的$AllCerts var包含来自每个商店的所有证书。然后,它还将它们导出到$env:temp文件夹中的CSV文件,并在Windows资源管理器中打开该文件夹。
pieyvz9o4#
很棒的剧本,我对它的命名有问题,可以很容易地成为我,但改变了这一点,对输出非常满意,谢谢!出发地: