You will need to edit the Connect-MDTDatabase line and plug in your MDT Database server name. Other than that, no configuration should be required. The script will cycle through your MDT database and remove duplicate IDs based on the AssetTag and the SerialNumber. If a duplicate item is found, it will assume that the older (lesser) ID is obsolete. It will remove that ID.

This script can be ran separately from your importing script or appended to the end of it. When your import script (and this script) are scheduled to run daily, any computer changes made in Active Directory will be updated in your MDT database! This makes imaging maintenance automated. If you have any issues (or comments), let me know!

What happens if there are duplicate entries for a computer name in the MDT database? For instance, lets say that I have two entries for the same mac address, with different computer names, or a similar scenario. Which one is chosen by ZTIGather?