Skip to content

Instantly share code, notes, and snippets.

@royashbrook
Created February 7, 2018 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save royashbrook/9165c6726c304904ee23e9b9196fefa1 to your computer and use it in GitHub Desktop.
Save royashbrook/9165c6726c304904ee23e9b9196fefa1 to your computer and use it in GitHub Desktop.
# Confirm system access:
"user1","user2" | Get-ADUser -properties * | ft SamAccountName, DisplayName, Enabled
# Disable:
"user1","user2" | Disable-ADAccount
# If processing a change for folks who should be terminated, easier to do this:
$userlist = "user1","user2"
$userlist | Get-ADUser -properties * | ft SamAccountName, DisplayName, Enabled
$userlist | Disable-ADAccount
$userlist | Get-ADUser -properties * | ft SamAccountName, DisplayName, Enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment