Search code examples
powershellpowershell-2.0powershell-remoting

PowerShell script failure on remote execution


On executing a PowerShell Remote Script I am getting an error like following

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.

The exact line of code the execution is breaking is as follows:

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

Can anybody help me to resolve out the issue??


Solution

  • It looks just like what the error says, you need to be trusted for delegation. I found these links on the web.