Get-ADOrganizationalUnit -filter * | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $true
This Powershell command gets a list of all organizational units in Active Directory and sets “ProtectedFromAccidentalDeletion” on them. To remove this attribute from your OU’s you can end the script with $false