Solved

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
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 transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

708 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

13 Experts available now in Live!

Get 1:1 Help Now