我正在尝试访问 IIS 10 商店上已安装证书的指纹。我正在使用以下命令
Get-ChildItem -path Cert:\LocalMachine\Personal
但上面的命令给了我以下错误
PS C:\Users\Administrator> Get-ChildItem -path Cert:\LocalMachine\Personal
Get-ChildItem : Cannot find path '\LocalMachine\Personal' because it does not exist.
At line:1 char:1
+ Get-ChildItem -path Cert:\LocalMachine\Personal
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (\LocalMachine\Personal:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
但是,以下命令返回有效的指纹
Get-ChildItem -path Cert:\LocalMachine\WebHosting
有趣的是,当我转到 IIS>Server Certificate 时,我可以看到有两个商店 WebHosting 和 Personal。
我查看了microsoft 文档并指出,这意味着有 WebHosting 和 Personal Store
虚拟主机商店的工作方式与个人商店类似,因此所有现有的导入和导出证书的工具都以相同的方式工作。虚拟主机商店和个人商店之间的主要区别在于虚拟主机商店旨在扩展到更多数量的证书。
谁能建议我为什么Get-ChildItem -path Cert:\LocalMachine\Personal
会抛出错误?