Help with Remote Desktop batch help

Status
Not open for further replies.

KNiGHTMaRe89

In Runtime
Messages
258
Hey fellas - im writing a batch file to run several didn't commands for my department, but I've been at a standstill for the past hour.

In WinXP Pro 32bit when you right click My Computer and go to Properties and click the Remote tab and you have the option to Select the Remote Users who can log in...I need to add a specific user on about 8,000 machines here. I figured I would incorporate this step with the rest of the batch file I'm writing but I can't find anything in the registry in regards to how to add this in the batch.

I've tried using Dependency Walker to see what's going on when RDC opens and I have also used RegShot and taken a before and after snapshot to see what's changed when I open the window, but I can't pinpoint anything solid.

Any help guys?
 
you're going to want to add the user to multiple remote machine's remote desktop user group.

this script will add them to admin group. make changes as necessary


List users in local administrators group on remote machine

10 Oct 2008 5:04 PMRichard Mueller [MVP]
Nick wrote:


Show quote
Hide quote
>
> I am looking to manage all desktops on our network with regard to the
> local
> administrators group. There are several things I am looking to
> accomplish:
>
> 1. list all users (domain and local) in local administrators group on
> multiple remote computers
> 2. remove user from local administrators group on remote computer
> 3. add domain user account to local administrators group on remote
> computer
> 4. remove local user account from remote computer
> 5. Report on current members of the local administrators group.
>
> Any assistance you can provide would be greatly appreciated.
> We have .Net software if that would be the best way to tackle this but I
> am
> not sure which way to go.


I have an example VBScript program that enumerates all members of local
Administrators group linked here:

Enumerate Local Group

The program handles membership due to nested local and domain groups. In
VBScript you use the WinNT provider with local objects. To add and/or remove
users (or groups) from a local group use code similar to below. With the
steps that check for direct membership (does not reveal membership due to
group nesting), you may not need to enumerate membership:
=========
' Specify NetBIOS name of computer.
strComputer = "Test001"

' Specify NetBIOS name of domain.
strDomain = "MyDomain"

' Bind to local Administrators group on remove computer.
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")

' Add a local user to the group.
' Check first if they are already a direct member.
Set objLocalUser = GetObject("WinNT://" & strComputer" & "/JimSmith,user")
If (objGroup.IsMember(objLocalUser.AdsPath) = False) Then
objGroup.Add objLocalUser.AdsPath
End If
 
Status
Not open for further replies.
Back
Top Bottom