Solved

Script to add Domain group to Local Admin group

Posted on 2011-02-24
2
314 Views
Last Modified: 2012-06-27
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
Comment
Question by:Kimberly1467
[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 Comments
 
LVL 47

Accepted Solution

by:
Donald Stewart earned 500 total points
ID: 34974531
It would be much easier to do this with Restricted Groups IMO

http://www.frickelsoft.net/blog/?p=13
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34974582
Definately use Group policy and restricted groups! Dont even consider a script.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

740 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