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/

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

Related Posts

Windows Server Summit 2026 Day 3 Dragons

Windows Server Summit 2026 – Day 3

Introduction to Windows Server Summit 2026 Day 3 The final day of the Windows Server Summit 2026 shifted the spotlight from overarching hybrid control planes toward core infrastructure, protocol modernization,…

Spread the knowledge
Read more
Azure Arc Agent 1.54 Stuck IT System Engineer Dragon concerned

Azure Arc Agent 1.54 Stuck? Fixing the WSUS Deadlock and Moving to 1.6x

Is your Azure Arc Agent 1.54 stuck and not updating? If that is the case you are in trouble. Azure Arc enabled servers operate on a strict twelve month support…

Spread the knowledge
Read more
IT operations dragon and the IT System Engineer dragon looking at a whiteboard showing Why Windows Server 2025 and WSUS are fine

Azure Arc – Enable Azure Arc Auto Updates using WSUS and GPOs

While our first part focused on the cloud-native way using Azure Portal and Policy, many IT administrators still prefer or require the reliability of on-premises control. In a traditional IT…

Spread the knowledge
Read more
WSUS Data Flow System Engineer with IT Architect and CISO

Windows Server 2025 – Part 9 (WSUS on Windows Server 2025)

WSUS on Windows Server 2025 continues In the previous parts of my Windows Server 2025 series, where I focused heavily on cloud-native management and the new features of Windows Server…

Spread the knowledge
Read more
Azure Arc Enable Azure Arc Auto Updates using Azure Portal

Azure Arc – Enable Azure Arc Auto Updates using Azure Portal

Azure Arc Auto Updates is key, as the foundation of your hybrid cloud strategy and it’s single contral plane in Azure is the Connected Machine Agent. While we often focus…

Spread the knowledge
Read more
CISO dragon and my IT architecture dragon looking at AGPM replacement

AGPM is End of Life on 14 April 2026

AGPM is End of Life on 14 April 2026. Microsoft’s Advanced Group Policy Management (AGPM) reaches its official End of Life (EOL) on April 14, 2026. After this date, the…

Spread the knowledge
Read more