Pages

Thursday, April 17, 2014

Remotely reconfiguring WinRM (Windows Remote Management)

I received a call a few weeks ago from a client indicating that the Activity portion of a Citrix XenDesktop virtual desktop was not reporting back with any data from within Desktop Director as shown in the following screenshot:

Failed to retrieve data: Machine unresponsive or reported an error (error code 105). View server event logs for further information.

image

I’ve come across issues like these in the past which are usually related to an issue with WinRM. The first troubleshooting step I usually take is to recreate the WInRM listener but the challenge we have with this environment is that majority of the users use dedicated desktops and it’s quite cumbersome to manually log into all of them, open up the command prompt and execute the following 2 commands to delete and recreate the WinRM listener as described in the KB http://support.citrix.com/article/CTX131197:

winrm delete winrm/config/listener?Address=*+Transport=HTTP

winrm create winrm/config/listener?Address=*+Transport=HTTP

To make the process a less labour intensive, I went ahead and downloaded Windows Sysinternals PsExec v2.1 to remotely execute the commands above. The tool can be found here: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Once PsExec has been downloaded and extracted to a directory, open up a command prompt, navigate to the directory with PsExec.exe and execute the following:

PsExec.exe <\\virtualMachineName> -u <domain\username> -p <somePassword> -s c:\windows\system32\cmd.exe

The following will be displayed once you’ve successfully connected to the remote desktop:

image

Once connected, proceed with execute the following 2 commands to delete and recreate the WinRM listener:

winrm delete winrm/config/listener?Address=*+Transport=HTTP

winrm create winrm/config/listener?Address=*+Transport=HTTP

image

There have also been some cases where I’ve had to execute the following command to correct the issue so I’ll include it here as well:

winrm set winrm/config/Service @{EnableCompatibilityHttpListener="true"}

image

If the problem was related to the WinRM listener, you should now see statistics displayed in Desktop Director for the VDI:

image

No comments: