我在Windows Server 2008 R2上使用PowerShell 2.0(因SP2010而必需).我需要从Windows Credential Manager检索进程的凭据.我似乎无法使其发挥作用.
我得到了这段代码:
[Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
(new-object Windows.Security.Credentials.PasswordVault).RetrieveAll() | % { $_.RetrievePassword(); $_ }
Run Code Online (Sandbox Code Playgroud)
这两行代码都会抛出错误
Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime : Unable to find type [Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]: make sure that the assembly containing this type is loaded.
Run Code Online (Sandbox Code Playgroud)
和
(new-object Windows.Security.Credentials.PasswordVault).RetrieveAll() | % {$_.RetrievePassword(); $_ }
Run Code Online (Sandbox Code Playgroud)
分别.我一直试图以某种方式导入PasswordVault类.到目前为止谷歌已经让我失望了,我甚至都无法找到它所在的组件.我错过了什么?