I have deployed a test VDI setup on 2012 R2 remote desktop services, and when I attempt to shadow a session on one of our Windows 10 virtual desktops, I get a message that says;

"The computer name is invalid"

I found this article, but even after enabling network discovery, the same error persisted when attempting to shadow the session.

Is there anything else I need to do to get this working?

  • how are you shadowing the session? GUI tool or commandline and are you using FQDN, short name, or IP – SpiderIce Oct 17 '17 at 13:59
  • Through server manager GUI – James Edmonds Oct 17 '17 at 16:08
  1. I would check DNS to make sure its working correctly
  2. try to shadow via commandline and use the IP address

    Mstsc.exe [/shadow:sessionID [/v:Servername] [/u:[Username]] [/control] [/noConsentPrompt]]

    /shadow:ID Starts shadow with the specified sessionID.

    /v:servername If not specified, will use the current server as the default.

    /u:username If not specified, the currently logged on user is used.

    /control If not specified, will only view the session.

    /noConsentPrompt Attempts to shadow without prompting the shadowee to grant permission.

  3. check your GPO settings

[Computer Configuration | User Configuration]\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections\Set rules for remote control of Remote Desktop Services user sessions

  1. make sure your an admin of that VDI desktop
  2. make sure your VDI is talking to the domain correcly

More infomation can be found at https://blogs.technet.microsoft.com/askperf/2013/10/22/windows-8-1-windows-server-2012-r2-rds-shadowing-is-back/

Update: This ps1 might help until the GUI is working correctly

$selected = Get-RDUserSession | Select-Object -Property Username,HostServer,UnifiedSessionID |Out-GridView -PassThru
mstsc /shadow: $selected.UnifiedSessionId /control /v: $selected.HostServer
| improve this answer | |
  • DNS is fine, and I can ping that Virtual Desktop from the server I am trying to connect from. Trying via the command line I get a message that states "The specified session is not connected". After I log into the Virtual Desktop, in task manager my session is RDP-Tcp#0, so I am using session 0, and the computer name of the virtual desktop. We don't specify any of those settings via GPO, and shadowing on our session hosts is working fine. I am a domain admin, so will be an admin on the virtual desktop. Domain connectivity seems fine too. – James Edmonds Oct 18 '17 at 8:48
  • For complete clarity, the command I am running is: mstsc /shadow:0 /v:FLX-VDI-2 /control – James Edmonds Oct 18 '17 at 8:54
  • Ok so as it turns out the session is not 0, it is 2. I had to run the query session command at the command line to determine the session ID. Now, when I do it via the CLI, it works correctly. This to me indicates an issue within server manager? Any thoughts why it works via CLI but not SM? Kind of makes life a bit awkward when trying to shadow users if we deploy this in a live environment! – James Edmonds Oct 18 '17 at 8:58
  • @JamesEdmonds it might be some issues with server manager and shortname vs FQDN. Could also be a bug from MS – SpiderIce Oct 18 '17 at 12:49
  • I did find it odd that when it attempts to shadow the virtual desktop, is says "Connecting to...The". Rather than giving me the computer name, it just says "The". I have created a post in the technet forum too, but seems like a pretty massive bug! – James Edmonds Oct 18 '17 at 15:44

Believe this is a bug in 2012 R2, as when I redeployed on 2016, it worked perfectly first time using the same VM template for my VDI.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.