Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # DisableADUsers.ps1
- # Disables a list of AD user accounts based on Displayname
- $Users = get-content "accounttodisable.txt"
- Get-ADUser -Filter '*' -Properties DisplayName,Office | where-object { $Users -contains $_.Displayname } | set-aduser -Enabled $FALSE
Add Comment
Please, Sign In to add comment