AD OU – Remove Protected From Accidental Deletion

When creating an OU in AD, ticking the Protect from Accidental Deletion box seems like a good idea. Until you go to delete the OU. Even more so if you have multiple nested OUs and just want to delete the top level one.

Powershell to the rescue! We can use Get-ADOrganizationalUnit (note US spelling) to select all the OUs within a supplied OU and then use Set-ADObject and ProtectedFromAccidentalDeletion

Once run, the top level OU can be deleted, removing all the sub OUs as well.




No Comments


You can leave the first : )



Leave a Reply

Your email address will not be published. Required fields are marked *