Solved

Script to add Domain group to Local Admin group

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now