Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Protecting All OUs in the Domain from Accidental Deletion

Updated: February 28, 2009

Applies To: Windows Server 2008 R2

This topic explains how to use the Active Directory module for Windows PowerShell to protect all organizational units (OUs) in the domain from accidental deletion.

The following example demonstrates how to protect all OUs in the Fabrikam.com domain from accidental deletion:

Get-ADOrganizationalUnit -Filter 'Name -like "*"' | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $true

In addition to the standard Lightweight Directory Access Protocol (LDAP) attributes, you can retrieve the following extended properties of the Get-ADOrganizationalUnit cmdlet by using the -Properties parameter:

  • StreetAddress

  • City

  • State

  • Country

  • PostalCode

  • Description

  • DisplayName

  • ProtectedFromAccidentalDeletion

  • AppliedGroupPolicies

You can use the following parameters when you set many of the common values that are associated with the modification of an OU:

  • Country

  • City

  • PostalCode

  • State

  • StreetAddress

  • Description

  • DisplayName

  • ProtectedFromAccidentalDeletion

  • ManagedBy

For a full explanation of the parameters that you can pass to Get-ADOrganizationalUnit or Set-ADOrganizationalUnit, at the Active Directory module command prompt, type Get-Help Get-ADOrganizationalUnit –detailed or Get-Help Set-ADOrganizationalUnit -detailed, and then press ENTER.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.