• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

Script to add Domain group to Local Admin group

I am trying to write a script that will add a domain group to the local admin group of computers located in a certain OU. I have been able to write a script to this one by one and only if I state the computer name. Is there a way to do this for multiple computers contain in a certain OU?

Here is the script I have so far:

strComputer = "happy"
Set objAdmins = GetObject("WinNT://" & strComputer & "/Administrators")
Set objGroup = GetObject("WinNT://co/itdivision")
objAdmins.Add(objGroup.ADsPath)
0
Kimberly1467
Asked:
Kimberly1467
1 Solution
 
Donald StewartNetwork AdministratorCommented:
It would be much easier to do this with Restricted Groups IMO

http://www.frickelsoft.net/blog/?p=13
0
 
Neil RussellTechnical Development LeadCommented:
Definately use Group policy and restricted groups! Dont even consider a script.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now