使用远程PSSession执行Get-WSManCredSSP命令时拒绝访问被拒绝

时间:2012-11-07 09:31:42

标签: powershell remoting credentials unauthorizedaccessexcepti

我有Windows XP x86和Powershell 2.0。

我打开Powershell控制台,执行Enter-PSSession命令连接Windows 2008 Server。

我希望远程执行Get-WSManCredSSP命令,但是我收到错误访问被拒绝。

PS C:\Documents and Settings\myuser> Enter-PSSession -Computername servermoss -Credential servermoss\installeruser

[servermoss]: PS C:\Users\installeruser\Documents> Get-WSManCredSSP -Verbose
Get-WSManCredSSP : Access is denied.
    + CategoryInfo          : PermissionDenied: (:) [Get-WSManCredSSP], UnauthorizedAccessException
    + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.WSMan.Management.GetWSManCredSSPCommand

Access is denied.
    + CategoryInfo          :
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.GetWSManCredSSPCommand

解决方案:WinRM 2.0 PowerShell不支持CredSSP

有什么建议吗?

2 个答案:

答案 0 :(得分:1)

实际上,您需要Enter-PSSession -Authentication CredSSP,但在此之前,本地计算机上需要Enable-WSManCredSSP -Role Client -DelegateComputer servermoss,但这在XP中不起作用。 XP中似乎支持WsMan CredSSP

答案 1 :(得分:1)

发布此解决方案,以防有人在不使用CredSSP的情况下解决DoubleHop的简单问题。尚未在Windows XP上尝试过,但可能会有效。

试试这个: https://www.powershellgallery.com/packages/Invoke-PSSession

它调用PSSession,然后使用您提供的凭据注册PSSessionConfiguration。基本上为DoubleHop提供凭证

然后使用Invoke-Command和新的PSSession。它应具备所需的权限,以满足您的需求。

相关问题