Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding users to the local administrators using a script 1

Status
Not open for further replies.

titresfct

IS-IT--Management
May 18, 2004
37
CA
I don't know if this is the right place to ask my question but here it is anyways.

I have to add a group to the local administrators group of every workstation on the domain. Using GPO's is not a possibility neither is doing it manually one station at a time.

I was wondering if i could modify our log on script to add the group? If it can be done can anyone tell me how ?

Thanks
 
I hope this helps, I hit a similar problem a few years back and used the following code in VB6, compiled it and ran from the logon scripts

Private Sub Form_Load()
Set SH = CreateObject("WScript.Shell")
Set objNet = CreateObject("WScript.NetWork")

addstr = "net localgroup ""Power Users"" ""Domain Users"" /add"

SH.Run addstr, 0, True
End
End Sub


This should set all domain users as power users on each machine when it is logged onto. It should give you a head start to modify for your own needs.

You must check this before running domain-wide as I cannot be held responsible for any side effects!

Master of Disaster.....Recovery
 
Thanks for the help but i found something that did the trick in one line.

net localgroup "Administrators" "DOMAINNAME\GROUP" /ADD
 
Just noticed it is basically one line from your suggestion but it can be ran without everything else and it works like a charm.

Thanks again.
 
Anyone who finds his own best answer deserves a star ;)

CJ

Don't drink and post, save that for driving home!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top