Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Vbscript question about Adding remote desktop users on Windows XP

Posted on 2006-11-16
3
Medium Priority
?
540 Views
Last Modified: 2012-06-27
How can the following process be automated.

Go to control panel
click on system
select the tab Remote
Click on select remote users.
Select another user.
0
Comment
Question by:itbabe
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
mdiglio earned 2000 total points
ID: 17957227
Hello,

This script will prompt you for a username then add it to the Remote Desktop Group


Set wshshell = CreateObject("WScript.Shell")
strDomain = wshshell.ExpandEnvironmentStrings("%USERDOMAIN%")
strComputer = wshshell.ExpandEnvironmentStrings("%COMPUTERNAME%")

strUser = InputBox("Enter the User Name for Remote Access")

Set objGroup = GetObject("WinNT://" & strComputer & "/remote Desktop users,group")
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
objGroup.Add (objUser.ADsPath)
0
 
LVL 16

Expert Comment

by:mdiglio
ID: 17971376
Hello,
You will need to copy what I wrote above into notepad then save it with a .vbs extension.
When you run it, you will be asked to enter a username
0
 
LVL 6

Expert Comment

by:tone28
ID: 17975327
Remote Desktop may not be enabled. I noticed that the above code only works for the local computer. So here is code to change the reg setting so Remote Desktop is enabled.

remoteEnabled = wshshell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnections")
If remoteEnabled = 1 Then
        wshshell.RegWRite "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnections",0,"REG_DWORD"
End If
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question