PS C:\> Disable-ADAccount jdoe -whatif
What if: Performing operation "Set" on Target "CN=Jack Doe,
OU=staff,OU=Testing,DC=mydomain,DC=local".


THIS WILL DISABLE THE ACCOUNT
PS C:\> Disable-ADAccount jdoe 

THIS WILL ENABLE THE ACCOUNT
PS C:\> Enable-ADAccount jdoe 

THIS WILL DISABLE BASED ON DEPARTMENT
PS C:\> get-aduser -filter "department -eq 'IT'" | disable-adaccount

THIS WILL ENABLE BASED ON DEPARTMENT
PS C:\> get-aduser -filter "department -eq 'IT'" | enable-adaccount


My Spiceworks Post
https://community.spiceworks.com/scripts/show/3268-ad-disable-enable-ad-accounts