Update to Find-DuplicateValues script

Update to Find-DuplicateValues script

  •  
  •  
  •  
  •  
  •  
  •  

Hey! As we enter the waning days of summer, I wanted to update a tool that I’ve had sitting around for a while.

Years ago, when I was in Microsoft Consulting Services, I ran into one particular customer that had manually populated the mail property of thousands of service accounts, groups, vendor accounts, and contacts–not with the object or user’s individual email address, but with the email address of the person who managed the AD object.  Thus, the Find-DuplicateValues script was born to help sort that out during a particularly large number of angrygrams from AAD Connect.

The tool largely sat dormant for years, and when we shut down the TechNet Gallery, I moved it over to the PowerShell Gallery without testing it on newer versions of PowerShell or Windows.  This week, someone asked for a little help on it.  Upon digging in, I could replicate a problem where when running it with certain combinations of parameters, it doesn’t always display helpful output to screen. So, I’ve resolved that, as well as a bunch of other things:

  • I’ve updated the way the legacy LDAP-style filtering is processed through the FormatColor function (which is used to highlight the duplicate values), so it’s now consistent with how it’s done in other places in the script. It would cause data to not be displayed in certain places.
  • I re-used the VerifyADTools function to determine (and optionally, install with the -InstallDependencies parameter) the Active Directory Remote Server Administration Tools.
  • Finally, I added a smidgen of checking/handling for when you supply either the -IncludeExchange or -IncludeSIP parameters, but don’t actually have your schema extended.  Instead of seeing script errors, you’ll see some text that will guide you to the correct cmdlets to extend the schema and our corresponding documentation.

Update to Find-DuplicateValues script

You can access this via PowerShell Gallery or install/update directly from your CLI:

Install: Install-Script Find-DuplicateValues

Update: Update-Script Find-DuplicateValues

And the script itself: https://www.powershellgallery.com/packages/Find-DuplicateValues/

 

 

Published by Aaron Guilmette

Helping companies conquer inferior technology since 1997. I spend my time developing and implementing technology solutions so people can spend less time with technology. Specialties: Active Directory and Exchange consulting and deployment, Virtualization, Disaster Recovery, Office 365, datacenter migration/consolidation, cheese.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.