Initiate Shadow Of Remote Connection From Server 2012 R2 Command Line

Terminal Services had the ability to shadow a user’s session; however, this was removed in Windows Server 2012. Now Windows Server 2012 R2 brings this capability back.  It can be initiated using Server Manager as shown below, but many people also want to initiate from the command line.

The old shadow.exe command is removed in Windows Server 2012 R2, so the trick is to use mstsc with new /shadow:<session id> switch. To find the list of sessions use the qwinsta.exe command, for example:

SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
services                                    0  Disc
console                                     1  Conn
rdp-tcp#37        bruce                     2  Active
>rdp-tcp#38        administrator             3  Active
31c5ce94259d4…                        65536  Listen
rdp-tcp                                 65537  Listen

This shows the session ID that I can then use (e.g., mstsc /shadow:2) for the user bruce session.

Categorised as: Microsoft, Networking, Server OS

Leave a Reply