Win Server 2016 - 事件 ID = 300,X509 存储位置 WindowsPowerShell 无效

Win Server 2016 - 事件 ID = 300,X509 存储位置 WindowsPowerShell 无效

我有一台 Windows Server 2016(Build 14393),正在运行 NPrinting(可能不相关)。我在星期五晚上进行了更新,看到 EventID=300 错误。以下是警告的全文。

Provider Health: Cannot find the certificate store 
because the specified X509 store 
location WindowsPowerShell is not valid.. 

Details: 
    ProviderName=Certificate
    ExceptionClass=ProviderInvocationException
    ErrorCategory=ObjectNotFound
    ErrorId=CertProviderItemNotFound
    ErrorMessage=Cannot find the certificate store because 
      the specified X509 store 
      location WindowsPowerShell is not valid.
    Severity=Warning
    SequenceNumber=109
    HostName=Default Host
    HostVersion=5.1.14393.3866
    HostId=49853eaf-740f-437f-b361-bb0b40af7e66
    HostApplication=C:\Windows\system32\wbem\wmiprvse.exe
    EngineVersion=5.1.14393.3866
    RunspaceId=19286b5f-7eb9-45bb-b26d-8fddbc61a25b
    PipelineId=132

我注意到,只有当我的Powershell ISE(Powershell 5.1.14393.3866) 打开时,错误才会大量出现。天哪,错误真的大量出现。

Powershell 失败问题

有人知道如何解决这个问题吗?非常感谢您的帮助

答案1

此警告来自 PowerShell,告诉您证书提供程序加载失败。

PowerShell 有一个内置于 Windows 的“提供程序”,可连接cert:到计算机上的证书存储,以便您可以轻松地在 PowerShell 中操作证书。以下是带有示例的详细说明https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-7

据我所知,只有两个有效的存储位置:CurrentUser 和 LocalMachine

你可以通过以下方式查看Get-ChildItem cert: | Format-List *

PSPath        : Microsoft.PowerShell.Security\Certificate::CurrentUser
PSParentPath  :
PSChildName   : CurrentUser
PSDrive       : Cert
PSProvider    : Microsoft.PowerShell.Security\Certificate
PSIsContainer : True
LocationName  : CurrentUser
Location      : CurrentUser
StoreNames    : {SmartCardRoot, Root, Trust, AuthRoot...}

PSPath        : Microsoft.PowerShell.Security\Certificate::LocalMachine
PSParentPath  :
PSChildName   : LocalMachine
PSDrive       : Cert
PSProvider    : Microsoft.PowerShell.Security\Certificate
PSIsContainer : True
LocationName  : LocalMachine
Location      : LocalMachine
StoreNames    : {TestSignRoot, ClientAuthIssuer, Remote Desktop, Root...}

您的错误表明 PowerShell 正在尝试打开名为 Location 的位置WindowsPowerShell,但找不到它,因为它无效。这是有道理的,因为没有同名的位置。

我会先检查您在驱动器中看到的位置cert:。您提到启动 ISE 时会弹出错误,ISE 中是否有任何附加组件?有错误的代码签名附加组件可能会尝试打开错误的位置并导致此错误。

相关内容