In some situation an entire structure of Organization Units must be deleted, and by default new OUs are automatic defined to protect them against deletion which requires the administrator to uncheck a property on each OU before deleting the entire structure.

Solution

Let’s use the following scenario, where we are trying to delete the Argentina OU and all its sub-OUs using Active Directory Users and Computers. We need to select the desired parent OU, and then remove it, a new dialog box asking for confirmation will be displayed, click on Yes.

The following dialog box will be displayed

If the Organization Unit is configured against accidental deletion the following error message will be displayed, click on OK.

The solution for a single OU is simple, click on Properties, and click on Object tab. Uncheck the Protect object from accidental deletion and then try to delete and it will work.

However, if we are trying to delete an entire tree of OUs, then we need to uncheck every single OU from the tree. The best way to do that is using PowerShell, we can use the following cmdlet to retrieve of all Organization Units starting on the Argentina OU.

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).

Categories

Follow us on Twitter

Welcome to the ITPROCentral.com!

We are an IT Pro resource site, here you'll find FREE tutorials, hints, downloads, scripts, reviews and IT news in general.

Here are some of the technologies that we covered on a regular basis: Microsoft Azure, Exchange Server, Active Directory, Hyper-V, Skype for Business, Virtual Machine Manager, System Center family and more..

If you want to contribute to the IT Pro Community, please drop us a line and start publishing your articles with us.