1

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?

James Edmonds
  • 1,733
  • 10
  • 37
  • 59

2 Answers2

2
  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
SpiderIce
  • 561
  • 2
  • 9
  • 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 08:48
  • For complete clarity, the command I am running is: mstsc /shadow:0 /v:FLX-VDI-2 /control – James Edmonds Oct 18 '17 at 08: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 08: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
  • @JamesEdmonds I edited my answer to include a script I found yesterday that might help you with this issue until the GUI is working. – SpiderIce Oct 18 '17 at 16:02
  • Silly how broken it is, as I can send a message and log off etc, just not shadow – James Edmonds Oct 19 '17 at 16:15
  • Just tried your script my friend, but I get told a deployment doesn't exist on this server. Odd, as this server runs all the roles, Connection broker, Web access and virtualisation host :S – James Edmonds Oct 19 '17 at 16:25
  • I would see if Get-RDUserSession will show anything run in powershell by itself on that server. – SpiderIce Oct 19 '17 at 17:27
  • Unfortunately it does not, as complains in the same way stating there is no deployment on that server. – James Edmonds Oct 20 '17 at 08:09
  • Works flawlessly when I redeployed on 2016 (same Windows 10 template), so I suspect this is a bug with 2012 R2. – James Edmonds Oct 30 '17 at 16:51
0

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.

James Edmonds
  • 1,733
  • 10
  • 37
  • 59