?
Solved

Vbscript question about Adding remote desktop users on Windows XP

Posted on 2006-11-16
3
Medium Priority
?
536 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: 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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

801 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