05 June 2013

Protect OU from accidental delettion

verifiy if all organizational units from your actuve directory domain are protected from accidental deletion:

Get-ADOrganizationalUnit -Filter * -Properties * | Select-Object name , ProtectedFromAccidentalDeletion

to protect all your organizational unit objects use:

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

users can also be protected using:

Get-ADObject -filter {(ObjectClass -eq "user")} | Set-ADObject -ProtectedFromAccidentalDeletion:$true

No comments:

Post a Comment