3

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??

RinoTom
  • 2,278
  • 2
  • 26
  • 40
  • Can anybody come up with any more to do than Jason told in the first answer? It will be very great – RinoTom Jun 30 '11 at 09:45
  • Probably is late but try to execute powershell locally to see if it fails the same. If it fails, try to execute it locally in an elevated powershell prompt... – Oscar Foley May 23 '12 at 16:40
  • 1
    Hi cad, thanks for the input, but I need to execute in remote mode itself. This is a script whiich is currently running fine in local execution. Something related remote access issues is this issue I hope – RinoTom May 30 '12 at 04:25
  • If it works in local and fails remotely you might then try something. Assuming that machine A is where powershell script and Machine B where you want to execute into. Grant administrator privileges in machine B to all MachineA (you can grant to a full machine) – Oscar Foley May 30 '12 at 08:04

1 Answers1

0

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

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • Thanks for those links... I have already done the settings for the corresponding account and the client computer to be delegated. Even in the client computer setspn is also executed successfully as being discussed in the second link. Is there any other options more to be done? – RinoTom Jun 30 '11 at 04:06
  • The machines I am working with are installed with **Windows Server 2008 R2** – RinoTom Jun 30 '11 at 04:14
  • I haven't dealt with this myself, so that's all the help I can be. :( – JasonMArcher Jun 30 '11 at 05:45