The 2nd Thing to Enable in Every AD – Protect object from accidental deletion

Protect object from accidential deletion is your 1st line of protection, if you value your OU structure. The checkbox “Protect object from accidental deletion” stops both accidental deletes and moves. Without it, one wrong click in ADUC or a faulty script can wipe out your OU hierarchy. Enforce it across the board — ideally automated with PowerShell.

Technical Background around Protect object from accidental deletion

The setting adds Deny Access Control Entries for “Delete” and “Delete Subtree” (usually against Everyone). This prevents both direct deletes and moves (since moves internally perform a delete on the source container). It’s simple, robust, and has been available for years.

Why Protect object from accidental deletion Matters

  • Stops the accident chain: One misplaced click can collapse half your AD structure.
  • Raises change discipline: You must consciously disable protection before deleting or moving an OU.
  • Supports safe delegation: You can delegate admin tasks without leaving the OU tree vulnerable.

Enabling Protection using the GUI

GUI (ADUC):
OU → Right-click → Properties → Object tab → Protect object from accidental deletion. Done. (To delete/move later, untick temporarily.)

Active Directory - Dragons - hartiga.de
Protect object from accidental deletion
Protect object from accidential deletion

Protect all OUs in a domain

Lets quicky look at Powershell options to enable “Protect object from accidental deletion”

PowerShell (at scale):

# Protect all OUs in a domain
Get-ADOrganizationalUnit -Filter * |
  Set-ADObject -ProtectedFromAccidentalDeletion $true

Create new OU with protection:

New-ADOrganizationalUnit -Name "Workstations" -Path "DC=contoso,DC=com" `
  -ProtectedFromAccidentalDeletion $true

Selective example:

Get-ADOrganizationalUnit -LDAPFilter '(name=*_PRD)' |
  Set-ADObject -ProtectedFromAccidentalDeletion $true

When You Do Need to Delete/Move

Disable the flag first, run the action, then re-enable it. For powershell use this command:

Set-ADObject -Identity "OU=Workstations,DC=contoso,DC=com" `
  -ProtectedFromAccidentalDeletion $false

Afterwards, reset it back to $true. Otherwise you’ll get Access denied — by design.

Delegation Scenarios

You can allow delegated groups to toggle this setting without granting full control. Build it into your RBAC model, document exceptions, and make it part of your operational standards.

Operational Recipes

Monthly baseline script: Re-applies protection on all OUs except a defined allowlist.

Provisioning scripts: Always include -ProtectedFromAccidentalDeletion $true when creating OUs.

Change windows: Require project teams to log where/when they disable the flag.

GPOs too: GPOs can be protected in GPMC the same way.

Audit events: Enable Directory Service Changes auditing for visibility.

Important – combine it with Recycle Bin & Backups

Protection stops mistakes before they happen.

  • Recycle Bin recovers objects after mistakes.
  • System State backups are your ultimate fallback.

Together, they form a layered defense. Check this guide on how to enable the recycle bin.

Troubleshooting for Protect object from accidential deletion

  • “Can’t delete an OU I need to remove”: Untick protection → delete → retick afterwards.
  • “Move operation fails”: Same reason — moving triggers delete on source.
  • Replication: ACE changes replicate like any other AD change; allow time across multi-DC setups.

Microsoft References for Protect object from accidential deletion

Bottom line: The checkbox may look old-fashioned, but it works. Combine it with Recycle Bin and auditing, and your AD becomes resilient, recoverable, and far easier to manage.

Conclusion around Protect object from accidential deletion

If Recycle Bin is your safety net after a fall, “Protect object from accidental deletion” is the guardrail that keeps you from falling in the first place.

It’s one of those small, almost boring settings that ends up saving you countless hours of cleanup. Accidental deletes and clumsy OU moves don’t just break your AD — they disrupt onboarding, GPO links, and sometimes entire service chains.

By enabling this flag everywhere (and baking it into your automation and operational procedures), you shift from reactive recovery to proactive prevention. Delegation becomes safer, change discipline improves, and your OU hierarchy stops living on borrowed time. Pair this with Recycle Bin and proper backups, and you’ve built a layered defense that’s both simple and powerful. Low cost, high return, no excuses — check the box, run the script, and make it part of your baseline today.

If you have any questions please don’t hesitate to reach out to me on LinkedIn, Bluesky or check my newly created Adaptive Cloud community on Reddit.
LinkedIn: https://www.linkedin.com/in/andreas-hartig/
Bluesky: https://bsky.app/profile/hartiga.de
Adaptive Cloud community on Reddit: https://www.reddit.com/r/AdaptiveCloud/

Avatar for Andreas Hartig
Andreas Hartig - MVP - Cloud and Datacenter Management, Microsoft Azure

Related Posts

the IT Operations dragon looking at multiple screens with Group Policies on them and the GPO Policy Analyzer checking them all

How to use the GPO Policy Analyzer

Managing Group Policy Objects across a complex Active Directory environment has always been a challenge. Administrators often inherit hundreds of GPOs with overlapping configurations, stale settings, and hidden conflicts. Finding…

Read more
WAU Happy Dragons crazy about 110 percent security

Schedule Winget Auto Updates for operational usage

Deploying Winget Auto Updates (WAU) gives you a functional update baseline, for full functionality we need to configure more to get ready for production. If servers query the Winget repository…

Read more
WAU Happy Dragons about improved security

Centralized Software Patch Management: Deploying Winget Auto Updates (WAU) via Active Directory GPO

Deploying Winget Auto Updates for Software Patch Management for managing third-party software updates across an IT infrastructure typically requires expensive enterprise solutions. This article provides a technical guide on how…

Read more
Stay Hydrated Drink enoughv2

GPO Central Store – Help! My PolicyDefinitions Folder is missing

Your PolicyDefinitions Folder is missing? The GPO Central Store is key for Managing Group Policy Objects (GPOs) across multiple domain controllers can introduce configuration drift if administrative templates are not…

Read more
A single control plane for LAPS using AzureArc

Legacy LAPS vs. Windows LAPS vs. LAPS for Azure Arc

LAPS for Azure Arc is the new shining star, after for years, IT teams relied on the classic, legacy Microsoft LAPS tool. Microsoft then integrated Windows LAPS directly into the…

Read more
Dragons looking at AccountLockout Tool

AD Account Lockout (Free Tool)

The AD Account Lockout tool is free and very valuable in troubleshooting account lockouts in Active Directory. This is a task as old as the directory service itself. Even in…

Read more