Microsoft KB Archive/321362

= How to Automatically Install Remote Desktop Sharing and Remote Assistance on Windows XP-Based Computers =

PSS ID Number: 321362

Article Last Modified on 7/30/2003

-

The information in this article applies to:


 * Microsoft Windows XP Professional SP1
 * Microsoft Windows XP Tablet PC Edition

-



This article was previously published under Q321362





IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SUMMARY
This article describes methods to automate the installation of Remote Desktop Sharing and Remote Assistance on Windows XP based computers.



MORE INFORMATION
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Remote Desktop Sharing is a single-user version of the Terminal Services server program. By default, it is not turned on in Windows XP-based computers. With Remote Assistance, a remote user can view your computer screen and chat online with you in real time about what you both see. With your permission, the remote user can use their mouse and keyboard to work with you on your computer. By default, Remote Assistance is also not turned on in Windows XP-based computers.

If you want specify the users who you want to grant remote logon to enable Remote Desktop Sharing and Remote Assistance in Windows XP, follow these steps:  In Registry Editor:  To turn on Remote Desktop Sharing, set the fDenyTSConnections value entry to 0 under the following registry key:  To turn on Remote Assistance, set the fAllowFullControl and the fAllowToGetHelp value entries to 1 under the same key. Set the value of the TSAdvertise value entry to 0. When you do so, Windows XP cannot advertise itself as a terminal server.  Add or remove relevant users to the &quot;Remote Desktop Users&quot; local group on the computer. Members in the &quot;Remote Desktop Users&quot; group are granted the right to logon remotely.</li></ol>

Use one of the following scripts to help you to automate these steps:

Step 1: Modify the Registry
' Sample script that enables Remote Desktop Sharing Dim strRegKey Dim WShell Set WShell = WScript.CreateObject(&quot;WScript.Shell&quot;) on error resume next

strRegKey = &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server&quot; & &quot;\&quot; & &quot;fDenyTSConnections&quot; CSCript.Echo &quot;Writing fDenyTSConnections to enable Remote Desktop Sharing...&quot; WShell.RegWrite strRegKey, 0, &quot;REG_DWORD&quot; if err.number = 0 then CScript.Echo &quot;Registry Write operation completed successfully.&quot; else CScript.Echo &quot;Registry Write operation failed!&quot; end if

strRegKey = &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server&quot; & &quot;\&quot; & &quot;fAllowFullControl&quot; CSCript.Echo &quot;Writing fAllowFullControl to enable Remote Assistance...&quot; WShell.RegWrite strRegKey, 1, &quot;REG_DWORD&quot; if err.number = 0 then CScript.Echo &quot;Registry Write operation completed successfully.&quot; else CScript.Echo &quot;Registry Write operation failed!&quot; end if

strRegKey = &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server&quot; & &quot;\&quot; & &quot;fAllowToGetHelp&quot; CSCript.Echo &quot;Writing fAllowToGetHelp to enable Remote Assistance...&quot; WShell.RegWrite strRegKey, 1, &quot;REG_DWORD&quot; if err.number = 0 then CScript.Echo &quot;Registry Write operation completed successfully.&quot; else CScript.Echo &quot;Registry Write operation failed!&quot; end if

strRegKey = &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server&quot; & &quot;\&quot; & &quot;TSAdvertise&quot; CSCript.Echo &quot;Writing TSAdvertise to prevent Terminal Server like advertisement...&quot; WShell.RegWrite strRegKey, 0, &quot;REG_DWORD&quot; if err.number = 0 then CScript.Echo &quot;Registry Write operation completed successfully.&quot; else CScript.Echo &quot;Registry Write operation failed!&quot; end if Set WShell = Nothing

on error goto 0

Step 2: Add and Remove Members to the Remote Desktop Users Group
To add and remove members to the remot desktop users group, use one of the following methods.

Method 1: Command Prompt Batch Commands
echo off echo To add a member net localgroup &quot;Remote Desktop Users&quot; &quot;User1&quot; /add /Computer1 echo To remove a member net localgroup &quot;Remote Desktop Users&quot; &quot;User1&quot; /delete /Computer1

Method 2: WSH VBScript
Dim openDS Dim group Set openDS = GetObject(&quot;WinNT:&quot;) set group = openDS.OpenDSObject(&quot;WinNT://Computer1/Remote Desktop USers&quot;, &quot;Computer1\Administrator&quot;, &quot;password&quot;, 1) On error resume next ' To add a member group.add(&quot;WinNT://Computer1/User1&quot;) ' To remove a member group.remove(&quot;WinNT://Computer1/User1&quot;) if err.number = 0 then CScript.Echo &quot;You local permissions have been changed.&quot; else CScript.Echo &quot;You local permissions cannot be changed!&quot; end if set group = Nothing set openDS = Nothing on error goto 0

Keywords: kbHOWTOmaster KB321362

Technology: kbWinXPPro kbWinXPProSearch kbWinXPProSP1 kbWinXPSearch kbWinXPTabPC

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2003 Microsoft Corporation. All rights reserved.