Wednesday, 18 November 2015

Protecting AD OUs from accidental deletion

Before carrying out an AD migration I always like to the the best practice analysers. 9 times out of ten these days we see that the BPA warns that all OUs should be protected against accidental deletion.

You can use the simple line of PoSh to protect all OUs and eradicate the BPA warning.

Get-ADOrganizationalUnit -filter * -Properties ProtectedFromAccidentalDeletion | where {$_.ProtectedFromAccidentalDeletion -eq $false} | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $true

No comments:

Post a Comment