Last active
December 12, 2015 01:38
-
-
Save ddhahn/4692234 to your computer and use it in GitHub Desktop.
Remove AD user from AD groups stored in a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#read a list of CN's of groups from a file and remove the specified user from | |
#that group | |
#uses the quest AD cmdlets.. Probable need to change to built in AD stuff. | |
$groups = Get-Content "c:\temp\groups_to_remove.txt" | |
foreach ($group in $groups) | |
{ | |
Write-Host $group | |
Remove-QADGroupMember -Identity $group -Member "contoso\mary" -WhatIf | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment