What's protected from accidental deletion in Active Directory?
Here's just a little tip I picked up from a presentation by Mark Broadbent (retracement on twitter). I'm the guy who wasn't listening! Mark stressed the importance of enabling the Protection from accidental deletion property in active directory for your Failover Clusters. Here's how to check this for Computers with Powershell.
This string of commands requires the AD Module. So if you're not using Powershell 3.0 you need to ensure this is loaded.
I've included a further filter in the Where-Object cmdlet because I'm only interested in SQL Servers. Remove or adjust this if needed.
Get-ADObject -Filter {ObjectClass -eq "Computer"} -Properties Name, ProtectedFromAccidentalDeletion | Where-Object {$_.Name -match "SQL"; } | Select Name, ProtectedFromAccidentalDeletion | Format-Table -Autosize;
The output will look something like below...
Name ProtectedFromAccidentalDeletion ---- ------------------------------- SQLSERVER1 False SQLSERVER2 False SQLSERVER3 False