Skip to content

Instantly share code, notes, and snippets.

@SweetAsNZ
Created July 10, 2022 22:05
Show Gist options
  • Save SweetAsNZ/01cd814ac4700e9d3758a196be8570c2 to your computer and use it in GitHub Desktop.
Save SweetAsNZ/01cd814ac4700e9d3758a196be8570c2 to your computer and use it in GitHub Desktop.
Get AD Users With Duplicate Mobile
# Get Users With A Duplicated Property e.g. Mobile Number
$Property = 'Mobile'
$A = Get-ADUser -Filter {($Property -like "*")} -Property $Property | Group $Property | Where-Object {$_.Count -ge 2} | Select-Object -ExpandProperty group |
Select-Object Enabled, Name, SamAccountName, $Property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment