Wednesday, May 13, 2009

Remotely enable Remote Desktop using WMIC

For Windows Server 2003 or 2008, run the following command in Command Prompt window:
wmic /node:"[ComputerName (in FQDN format)]" RDTOGGLE WHERE ServerName="ComputerName" CALL SetAllowTSConnections 1
For Windows XP SP2 or SP3:
wmic /node:"HostName" path win32_terminalservicesetting where servername="HostName" call SetAllowTSConnections 1
Replace [ComputerName (in FQDN format)], ComputerName or HostName with actual computer name or host name.
Note that for remotely enable Remote Desktop feature to work, user must log on to the local computer with an admin account or user account of local admin group that has administrative privileges on the remote computer.
Example from a Vista PC named
wmic /node:"" path win32_terminalservicesetting where servername="vxp-n01" call SetAllowTSConnections 1

No comments:

Post a Comment