Solved

Vbscript question about Adding remote desktop users on Windows XP

Posted on 2006-11-16
3
524 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now