MilesLogan
asked on
Remove old SIDS from multiple AD groups with powershell
Hi EE
I have a list of old SIDS I need to remove from groups but instead of doing one at a time , I wanted to add all the SIDS and groups
to a CSV file and remove them faster ...
I was thinking something like this ... but I need help completing it or if someone already has this .
$sids = import-csv .\RemoveSIDS.csv
Foreach ($sid in $sids) {Set-ADGroup $sids -remove @{SIDHistory=$sid.value} }
What would my CSV file headers be ? how do I reference that in the script ?
one column would have the SID and the other column would be the group name that it needs to remove the SID from .
this does one at a time .
Set-ADGroup <Groupname> -remove @{sidhistory="S-1-5-21-xxx xxxxxx-xxx xxxxxx-xxx xxxxxxx-xx xx"}
I have a list of old SIDS I need to remove from groups but instead of doing one at a time , I wanted to add all the SIDS and groups
to a CSV file and remove them faster ...
I was thinking something like this ... but I need help completing it or if someone already has this .
$sids = import-csv .\RemoveSIDS.csv
Foreach ($sid in $sids) {Set-ADGroup $sids -remove @{SIDHistory=$sid.value} }
What would my CSV file headers be ? how do I reference that in the script ?
one column would have the SID and the other column would be the group name that it needs to remove the SID from .
this does one at a time .
Set-ADGroup <Groupname> -remove @{sidhistory="S-1-5-21-xxx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER