Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/fbsqlcom/public_html/youdidwhatwithtsql.com/wp-includes/pomo/plural-forms.php on line 210

Warning: Cannot modify header information - headers already sent by (output started at /home/fbsqlcom/public_html/youdidwhatwithtsql.com/wp-includes/pomo/plural-forms.php:210) in /home/fbsqlcom/public_html/youdidwhatwithtsql.com/wp-content/plugins/wordpress-mobile-pack/inc/class-wmp-cookie.php on line 50
youdidwhatwithtsql.com » Blog Archive » What’s protected from accidental deletion in Active Directory?

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

Leave a Reply