Solved

Script to add Domain group to Local Admin group

Posted on 2011-02-24
2
312 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

776 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