How to Enable "Protect Object from accidental deletion" for entire organization. RRS feed

  • Question

  • Hi All,

    I have enabled Protect Object from accidental deletion Option for all OU's, Now I need to enable Computer & User Object for entire organization.

    Enabling object wise, is there any script or command to enable "Protect Object from accidental deletion".

    Also we need to deny access permission for renaming the OU's. 

    Kindly help.



    Tuesday, December 20, 2011 4:22 PM


  • Hi All,

    Recently we got tasked with protecting all objects in a specific  OU from accidental deletion. There were about 60 users in this OU so we wanted to script this and by scripting this we would also be able to set up a scheduled task so that the change got applied to new users who got added to the OU also.

    First of all open PowerShell and run “Import-Module activedirectory”

    Now run the following but obviously change the DN name so that it points at the OU relevant for your domain.

    Get-ADobject -Filter * -SearchBase “OU=Users,DC=Domain,DC=com” | Set-adobject -ProtectedFromAccidentalDeletion $true




    • Marked as answer by Gangaiyan Friday, December 23, 2011 6:00 PM
    Friday, December 23, 2011 6:00 PM

All replies