Alert – Duplicate Objects in AD Created by Replication Conflict

Active Directory (AD) is a critical component in the Microsoft Windows ecosystem, serving as a directory service to manage and organize objects within a network.

While AD is a powerful tool for centralizing user, group, and computer information, it’s not immune to issues such as duplicate objects, especially when replication conflicts occur.

In this blog, we’ll explore how to find duplicate objects in Active Directory and how to address objects created due to replication conflicts.

Duplicate objects in Active Directory refer to instances where two or more objects with the same properties exist within the directory.

These duplicates can disrupt the functionality and integrity of your directory services. One common cause of duplicate objects is replication conflicts, which occur when updates made to the directory on different domain controllers are not synchronized properly. The result is multiple objects representing the same entity.

I am sharing a scripting solution that you can run on schedule to find the duplicate users or group objects created which has caused issue for one of our clients on some rare occasions.

Prerequisites for this Solution:

Download the script from Git or PowerShell gallery from below links:

Git:

https://github.com/VikasSukhija/Downloads

findduplicateobjects.ps1

PowerShell Gallery:

https://www.powershellgallery.com/packages/findduplicateobjects

Install-Script -Name findduplicateobjects

Update the below section of the script with your own parameters:


Now just schedule the script via task scheduler or if you want to run on demand just run it in powershell.

It will generate the Alert with report and send on the email specified in variable $email1

Here is the example report that will be received.


Here is the CSV look like:


The script logic is to get all the user/group objects and filter by objects that have samaccountname as *DUPLICATE*.

 

 

Thanks for reading and downloading…

Tech Wizard

 

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Fast Track

Leave a comment