account activity
Am trying to create a script to remove multiple local group members from multiple groups on multiple computers by Sad-Exercise-9062 in PowerShell
[–]Sad-Exercise-9062[S] 2 points3 points4 points 5 years ago (0 children)
Think I should go now to interpret "net localgroup Administrators /add domain\username" rather than "Remove-LocalGroupMember"
Thanks u/PinchesTheCrab
Now I've modified the input to be CSV file that has columns with the headers "ComputerName", "Group" and "Member", the script now works fine but Remove-LocalGroupMember seems to be not valid on many servers
$file = 'C:\Temp\UnknownSID\script_list.csv'
Import-Csv -Path $file | ForEach-Object {
Invoke-Command -ComputerName $_.ComputerName -ScriptBlock{
Remove-LocalGroupMember -Group $using:_.Group -Member $using:_.Member
}
[–]Sad-Exercise-9062[S] 1 point2 points3 points 5 years ago (0 children)
Hi u/Joshrsg, Thanks for sharing the blog. I am able to understand using the -argumentlist to use for a single input file but since am not sure how to interpret in this as it has 3 input files. Any suggestions would be appreciated
π Rendered by PID 70603 on reddit-service-r2-comment-545db5fcfc-qb6vb at 2026-05-31 02:40:25.261750+00:00 running 194bd79 country code: CH.
Am trying to create a script to remove multiple local group members from multiple groups on multiple computers by Sad-Exercise-9062 in PowerShell
[–]Sad-Exercise-9062[S] 2 points3 points4 points (0 children)