How to find two value duplicate user in active directory

%3CLINGO-SUB%20id%3D%22lingo-sub-957623%22%20slang%3D%22en-US%22%3EHow%20to%20find%20two%20value%20duplicate%20user%20in%20active%20directory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957623%22%20slang%3D%22en-US%22%3E%3CP%3Ehi%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20I%20want%20find%20user%20in%20active%20directory%20has%20value%20duplicate%20with%20attribute%20as%20employeeID%20and%20mobile%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20if%20find%20only%20one%20then%20i%20have%20a%20script%20below%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Get-ADUser%20-Filter%20%7B(employeeID%20-like%20%22*%22)%7D%20-property%20employeeID%20%7CGroup%20employeeid%20%7C%20%3F%20%7B%24_.Count%20-ge%202%7D%20%7C%20select%20-ExpandProperty%20group%20%7C%20Select-Object%20Enabled%2C%20ObjectClass%2C%20Name%2C%20distinguishedName%2C%20SamAccountName%2C%20employeeID%20%7C%20Export-Csv%20C%3A%5CScripts%5CFindDuplicateValueUser%5CemployeeId_is_duplicate.csv%3C%2FP%3E%3CP%3EBest%20Regards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-957623%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957687%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20find%20two%20value%20duplicate%20user%20in%20active%20directory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957687%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20script%20looks%20OK%20to%20me%2C%20not%20sure%20what%20the%20question%20is%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Contributor

hi

    I want find user in active directory has value duplicate with attribute as employeeID and mobile

    if find only one then i have a script below

    Get-ADUser -Filter {(employeeID -like "*")} -property employeeID |Group employeeid | ? {$_.Count -ge 2} | select -ExpandProperty group | Select-Object Enabled, ObjectClass, Name, distinguishedName, SamAccountName, employeeID | Export-Csv C:\Scripts\FindDuplicateValueUser\employeeId_is_duplicate.csv

Best Regards

 

1 Reply

The script looks OK to me, not sure what the question is?