远程执行时PowerShell脚本失败

远程执行时PowerShell脚本失败,powershell,powershell-2.0,powershell-remoting,Powershell,Powershell 2.0,Powershell Remoting,在执行PowerShell远程脚本时,我遇到如下错误 Invoke-Command : Exception calling "ToXmlString" with "1" argument(s): "The requested operation cannot be completed. Th e computer must be trusted for delegation and the current user account must be configured to allow dele

在执行PowerShell远程脚本时,我遇到如下错误

Invoke-Command : Exception calling "ToXmlString" with "1" argument(s): "The requested operation cannot be completed. Th
e computer must be trusted for delegation and the current user account must be configured to allow delegation.
执行中断的确切代码行如下所示:

    $rsa = New-Object System.Security.Cryptography.RSACryptoServiceProvider
    $key = $rsa.ToXmlString($true)

有谁能帮我解决这个问题吗???

看起来就像错误所说的,你需要信任才能授权。我在网上找到了这些链接


感谢您的链接。。。我已经为相应的帐户和要委派的客户端计算机进行了设置。即使在客户端计算机中,setspn也会成功执行,如第二个链接中所述。还有其他选择吗?我正在使用的机器都安装了Windows Server 2008 R2,我自己还没有处理过这个问题,所以我只能提供以下帮助:(有人能想出比Jason在第一个答案中说的更多的事情吗?可能会很晚,但请尝试在本地执行powershell,看看它是否失败。如果失败,请尝试在提升的powershell提示符下在本地执行它…嗨,cad,感谢您的输入,但我需要在远程模式下执行。这是一个脚本whiich当前在本地执行中运行正常。与远程访问相关的问题就是这个问题。我希望如果它在本地运行并且远程失败,那么您可以尝试一些方法。假设计算机A是powershell脚本的执行位置,计算机B是您要执行到的位置。将计算机B中的管理员权限授予所有计算机A(您可以授予一台完整的计算机)