1
I made this simple script to remove a particular group from AD users via .csv
but is accusing error that the $_.user
has not been identified or is empty.
Import-Csv -Path "C:\Users\antonio.costa\Documents\office365\vpn.csv"
ForEach {
Remove-ADPrincipalGroupMembership -Identity $_.user -MemberOf "Acesso_vpn"
}
break
This break I added to see it stopping on the screen, but besides giving the error and not stop, already closes soon.
Read on: https://docs.microsoft.com/pt-br/powershell/scripting/learn/understanding-the-powershell-pipeline?view=powershell-6
– Augusto Vasques