August 25, 2015

Protecting Active Directory Objects From Accidental Deletion

IT professionals sometimes worry when enabling Domain Administration or other Active Directory privileges to designated local administrators. Accidents can and will happen. One of the more common accidents is the deletion of objects and/or profiles in Active Directory.  The Windows Server 2012 R2 implementation of Active Directory provides a solution to protect sensitive items in an organization’s AD from accidental deletion.
Active_Directory_accidental_deletion
The checkbox highlighted in the image above protects against accidental deletion within Active Directory. 
Instead of browsing through multiple properties pages to enable this checkbox, the following PowerShell script can automate the process: 
$arrOUs = @("Sensitive OU1","Sensitive OU2")
$arrOUs | % { Get-ADObject -SearchBase "OU=$($_),DC=sub,DC=domain,DC=tld" -filter {(ObjectClass -eq "group")} | Set-ADObject -ProtectedFromAccidentalDeletion:$true }
$arrOUs | % { Get-ADObject -SearchBase "OU=$($_),DC=sub,DC=domain,DC=tld" -filter {(ObjectClass -eq "user")} | Set-ADObject -ProtectedFromAccidentalDeletion:$true }
Get-ADOrganizationalUnit -filter * | Set-ADObject -ProtectedFromAccidentalDeletion:$true
The 1st line defines an array of names of the sensitive OUs in question. The second and third lines get all the AD objects in the sensitive OUs with an ObjectClass of group or user and protect them from accidental deletion. Line 4 protects all OUs in AD from accidental deletion.

Related Posts:

  • Fix: The trust relationship between this workstation and the primary domain failed C1: xóa computer accountC2: disjoin domain cach đó la dễ nhất rồi, bên này cung co 1 so máy hay bị. thấy da số toan disjoin roi join kể cả HP cũng thế, nó tạo cái tool tự disjoin và join lại Lỗi nầy thuờng là do trùng c… Read More
  • Hướng dẫn kích hoạt Microsoft Remote Desktop Licensing Hướng dẫn kích hoạt Microsoft Remote Desktop Licensing Nếu hình ảnh bị lỗi các bạn có thể xem bài viết bên này http://www.slideshare.net/laonap166/hng-dn-kch-hot-microsoft-remote-desktop-licensing Xin chào các bạn, hô… Read More
  • Hướng dẫn đổi tên máy Domain Controller Khi quản trị hệ thống Active Directory, có thể các bạn sẽ có nhu cầu đổi tên của các máy Domain Controller. Trong quá trình thực hiện đổi tên của Domain Controller các bạn phải bảo đảm cập nhật được các DNS record (như các r… Read More
  • Backup và restore cấu hình IIS7.5 Cách backup và restore cấu hình IIS7.5 IIS của bạn đang triển khai rất nhiều Website. Khi nào cài đặt lại hệ điều hành hay muốn chuyển các Website từ Server này sang Server khác, chúng ta chỉ việc backup trên hệ thống cũ và… Read More
  • Cấu hình Network Load Balancing trên windows server 2008 Network Load Balancing Như chúng ta đã biết trong hệ thống mạng khi cần cân bằng tải cho những dịch vụ như: Web, Mail, FTP, VPN, File, Print service… thì chúng ta cần phải cấu hình hệ thống Load Balancing hoặc Clustering. T… Read More

0 comments:

Post a Comment