Hi everyone,
I would like to use PS to search for all disabled accounts in the domain except for one OU; how can I modify below for this?
Search-ADAccount –AccountDisabled –UsersOnly –SearchBase “DC=abc,DC=ca”
I would like to exclude the built-in Users OU.
Also, I would like to modify the below only for disabled user accounts; how can I accomplish that?
Set-ADOrganizationalUnit
-ProtectedFromAccidentalDeletion
$False
Thanks so much in advance.