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

Dragon Active Directory Recycle Bin

The First Thing to Enable in Every AD – Active Directory Recycle Bin

The Active Directory Recycle Bin is not a “nice-to-have” in 2025 — it’s mandatory. It allows fast, attribute-preserving recovery of deleted AD objects without the pain of authoritative restores. It…

Spread the knowledge
Read more
Automation via Group Policyv2

Automation using Group Policy – Background

Automation using Group Policy is most likely the easiest step in your environment for custimzation. In one of the latest Blog articles we looked into “Group Policies and Group Policies…

Spread the knowledge
Read more
Cyber dragon designs IT architecture and taking a risk among glowing screens

Windows Server 2025 Autologon: When and Why?

Windows Server 2025 Autologon is a challenging discussion. Learn why, when and how to enable Autologon in Windows Server 2025 safely, plus robust mitigation strategies. A reboot that lands on…

Spread the knowledge
Read more
Cyber dragon sits at a bright wooden desk coding on a Windows Server screen with stack of books

Group Policies and Group Policies Preferences (2025)

For Group Policies the time between Windows Server 2022 and Windows Server 2025 had a focus to move Group Policies and Group Policies Preferences towards being code-driven solution rather than…

Spread the knowledge
Read more
A Shadowrun style dr

Windows Server 2025 – Part 8 (Configuring Highly Available DHCP)

Highly Available DHCP is the backbone of network connectivity in modern infrastructures. When DHCP fails, clients lose IP leases, hindering access to services. Windows Server 2025’s built-in DHCP failover ensures…

Spread the knowledge
Read more
Windows Server 2025

Windows Server 2025 Summit – Session List

I couldn’t attend the Windows Server 2025 summit and missed the sessions. Luckily, all the sessions are available On_Demand to review. To follow them up, I created a list of…

Spread the knowledge
Read more