Solved

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

Posted on 2013-01-08
3
649 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
Synchronize a new Active Directory domain with an existing Office 365 tenant
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

910 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

25 Experts available now in Live!

Get 1:1 Help Now