Solved

PowerShell - Quest - How to nest a group into multiple servers .

Posted on 2013-01-08
3
672 Views
Last Modified: 2013-04-26
I have a list of servers that I need to nest a group in the Local Administrators group.
Anyone know how I can add the list of servers to a text file and then nest a group into all those servers ?

I cant do it via GPO since they are all in different OUs.
0
Comment
Question by:MilesLogan
3 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38758288
Try this for adding the Domain Group to the local Admin group.
GC C:\Servers.txt | %{

$domain="YourDomain.com"
$group = "YourGroup"

([adsi]"WinNT://$_/Administrators,group").Add("WinNT://$domain/$group,group")
}

Open in new window

0
 
LVL 2

Author Closing Comment

by:MilesLogan
ID: 38759602
Worked perfect ! thank you !
0
 

Expert Comment

by:cawasaki
ID: 39115396
sorry!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 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