Chris Beams’s Blog

Active Directory and more….

PowerShell – protect objects from accidental deletion

Posted by chrisbeams on March 10, 2010

Using PowerShell V2 and the new AD Cmdlets

in the below example on an OU

Get-ADOrganizationalUnit  -filter * | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $true

and to do the reverse to one OU

Set-ADOrganizationalUnit “OU=London,DC=W2K8R2,DC=NET -ProtectedFromAccidentalDeletion $False

Advertisements

One Response to “PowerShell – protect objects from accidental deletion”

  1. […] Protect objects from accidental deletion with PowerShell […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: