Tuesday, March 13, 2012

Protect Multiple objects from accidental deletion via AD PowerShell

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
All users in the OU should now be protected from accidental deletion 

No comments:

Post a Comment