AD- batch enable account command Enable-adaccount
Learn from:
Teacher Xu Peng's AD Powershell series of video courses
The user's current status is disabled
Execute the following command, and the user is enabled (the following is for users under the Lab organizational unit)
Get-ADUser-SearchBase "ou=Lab,dc=satid,dc=com"-Filter * | Enable-ADAccount
The user has disabled by executing the following command
Get-ADUser-SearchBase "ou=Lab,dc=satid,dc=com"-Filter * | Disable-ADAccount