Discussion Locked

Add global grp to local grp on wrkstn

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,
I need to add a global domain group into the administrators local group on approximately 1500 NT4 workstations. Obviously, this is something that I will need to automate using a script or utility. Any help would be greatly appreciated.

7 replies

by tamj123

try this VBscript

Dim DomainName
Dim UserGroup
Set net = WScript.CreateObject("WScript.Network")
local = net.ComputerName
DomainName = "nni" 'replace it with yours Domin Name
UserGroup = "CTXAdmins" 'replace it with yours Group Name

set group = GetObject("WinNT://"& local &"/Administrators")

on error resume next
group.Add "WinNT://"& DomainName &"/"& UserGroup &""
CheckError

sub CheckError
if not err.number=0 then
set ole = CreateObject("ole.err")
MsgBox ole.oleError(err.Number), vbCritical
err.clear
else
MsgBox "Done."
end if
end sub

by stillatit

The NET command will do the job (type NET HELP LOCALGROUP for details). The problem is going to be executing it on each machine. Since you need admin rights in order to add users to a group, you may have a problem.

Usually, when a workstation joins a domain, the domain Domain Admins group is added to the station's Administrators group. If this was done, the following may work. Note that doing this is a very real security risk if anyone realizes what you have done during the period you are doing it.

1. Find a program which will send email from the command prompt. Put a copy on a server in some place where everyone can run it.

2. Design a batch file with a sequence of instructions which will create a local log file, plug in the station name, use the NET command to add to the Administrators group, saving the output to the log file, list the local administrators group, putting the output in the log file, then mail the log file to you. Put in an instruction at the top to check forthe log file and bail out if it is found, so you don't run the batch file twice on any machine. Put this batch file in an accessable spot on a server.

3. Some morning, just before everyone comes in, put everyone (or the Domain Users group) into the Domain Admins group, and put the command to run the batch file into the login scripts. To be slightly safer, remove the the domain rights of the Domain Admins group.

4. After a reasonable time, take out the command and the group membership and put Domain Admins back the way it was.

5. You will still need to verify each station. You will have an email from each station where it worked. For the rest you can put the appropriate users into Domain Admins and wait until they log on, or send them mail asking them to log on.

Good luck

by jstankos

Regulations prohibit giving any non-systems user admin priveleges...even temporarily.

by frobo

Hi,

the other Ideas are not bad, but think about the following:
Their are several Problems to solve:
1. An User has no right to change Securtiy issues.
2. You had to do it on several clients at the same time.

First take the Idea with the NET Group Command, and wrote a batch.
Create an hidden Share on Server, who is reachable from every where, and place the batch their.
Now you have several methods to finish the Job, the first Solution is to modify the RegistryKey Run with an .REG File in the Logonscript.
In this Regkey put your script
very simlar to this: start CMD /T:0a /K "yourscript.cmd".

The other Method is, this is my favorite, use the AT Command, cause this has system privs. The Problem is that you had tostart the schedulerservice on the Machine first.
But this you could do with an script either and use the NET command for it.

If you want an ready solution, and wana pay for it then look at www.bhs.com under Admintools.

regards

Frobo

by jstankos

I actually did end up using AT on the workstations. I used a program called Hyena to push out the necessary AT jobs to all 1500 workstations at once.

This discussion is closed to new replies.