List Active Directory Objects Not Marked For ProtectFromAccidentalDeletion

Query King | Sun, 13 Aug 2017 at 06:52 hours | Replies : 2 | Points : 100

Category : Active Directory

Script to list all Active directory Users, Group, OU and computer, which is marked Not marked for ProtectFromAccidentalDeletion.

This Question is already solved Click To See The Answer

Hi Query King,


Find the PowerShell script below.


Import-Module ActiveDirectory
Get-ADObject -filter {ObjectClass -eq "user" -or objectclass -eq "computer"-or objectclass -eq "group" -or objectclass -eq "OrganizationalUnit"} -Properties ProtectedFromAccidentalDeletion | where {$_.ProtectedFromAccidentalDeletion -eq $false} | Export-csv List.csv


If you get any execution error, make sure Script execution is enabled as per

Excellent ! I was looking for same.