I have a CSV file with all users I want to delete from the administrator local group. So for instance, in one workstation, in the local administrator group has three users (Jose, Mary, Anna) and in the CSV file has Jose and Mary, in the local administrator group after launching the script should be only Anna. I hope I explain properly
I've done this script in PowerShell, but doesn't work.
Import-Csv -path "C:\Temp\Files\Users.csv" | ForEach-Object {Remove-localgroupmember -Identity "Administrators" -Members $_.'Account' -Confirm:$false}
Please anybody helps me??