Clear Protected from accidental deletion flag

Windows Active Directory protects per default Organizational Units (OU) from accidential deletion .

To clear this flag for an entire OU structure you can use this Powershell commands . This example command will remove the flag from an OU structure  OU=acme,DC=scom,DC=local and all child OUs .

sl AD:
sl "dc=scom,dc=local"
get-childitem -recurse OU=acme | where {$_.ObjectClass -match "organizationalUnit"} | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $false
This entry was posted in Information Technology, Tips and tagged , . Bookmark the permalink.

Comments are closed.