Protect OU from accidental deletion

Activate protection on a specific OU and all sub OUs

Get-ADOrganizationalUnit -SearchBase ‘OU=myOU,DC=domain,DC=net’ -filter * -Properties ProtectedFromAccidentalDeletion | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $true

Deactivate protection on a specific OU and all sub OUs

Get-ADOrganizationalUnit -SearchBase ‘OU=myOU,DC=domain,DC=net’ -filter * -Properties ProtectedFromAccidentalDeletion | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $false

Leave a Reply

avatar
  Subscribe  
Notify of
We use cookies to improve the user-friendliness and stats of the website. Through your visit, you agree with that.