如果您在 Windows 的证书管理器中打开证书的属性窗口,您将看到友好名称和描述字段。 我正在尝试通过 powershell 以编程方式访问描述字段。
通过 powershell 的证书提供程序 cert 访问证书时:您将获得一个仅将FriendlyName 公开为名称的对象。
据我所知,这都是 CAPICOM API 的包装器。 描述或 get_extendedproperties 方法均未公开。
如何通过 powershell 有问题地访问描述字段? 请注意,我尝试直接
$store = new-object -com "CAPICOM.Store"
使用 CAPICOM api 此链接,但我在 64 位 Win2K8 机器上收到 80040154 错误。
If you open the properties window of a certificate in the certificate manager in windows you will see both a friendlyname and description field. I'm trying to get to the description field programatically via powershell.
When accessing the certificates via powershell's certificate provider cert: you get an object that only exposes the FriendlyName as Name.
As far as I can tell, this is all a wrapper to the CAPICOM APIs. Neither the description or the get_extendedproperties method are exposed.
How can I access the description field problematically via powershell? Please note that I tried to simply do
$store = new-object -com "CAPICOM.Store"
to use the CAPICOM api directly ala This Link, but I get a 80040154 error on my 64bit Win2K8 box.
发布评论
评论(1)
打开 x86 Powershell 而不是 x64。 这应该可以帮助您开始:
Open x86 Powershell instead of x64. This should get you started: