Solved

Vbscript question about Adding remote desktop users on Windows XP

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

732 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