Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PowerShell - Quest - How to Remove a group from multiple machines.

Posted on 2013-01-09
2
Medium Priority
?
759 Views
Last Modified: 2013-01-10
I just got great help from Subsun on adding a group to multiple machines ( link below) , now Id also would like to be able to remove a group from multiple machines .

Thank you for all the help !

http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_27989227.html
0
Comment
Question by:MilesLogan
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 2000 total points
ID: 38760005
You just need to change Add to Remove
GC C:\Servers.txt | %{

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

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

Open in new window

0
 
LVL 2

Author Closing Comment

by:MilesLogan
ID: 38763873
Thank you !
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

877 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