PowerShell Script: Check user profiles

I have been asked many times how to check if Active Directory Import is working. With User Profile Synchronization, we had the FIM client to show what was updated during the MOSS_Export step.

The script I wrote uses DirSync which allows for incremental checks against Active Directory. This will create a cookie.bin that will keep track of state of AD when you ran it last. The account we would like to use is the same account you’d use sync user profiles.

The service account we would need to run this with your sync account that will connect to Active Directory with Replicate Directory Changes.

Adjust the script to match your environment. Be sure to add the mappings.xml file to the folder specified on Line 11.


Mappings

Mappings can be added or subtracted from the mappings.xml file that is included. This file is needed to know what we would like to check from AD to SharePoint. When adding in additional mappings, be sure to match the internal name(s) of the profile properties.


Results

The script will out put a CSV with tab as the delimiter character. This will allow easier sorting to troubleshoot the specific user profile. UPA Value column is what the user profile has


For a good troubleshooting guide user profiles not syncing check out my colleague Josh’s guide: https://joshroark.com/sharepoint-all-about-non-imported-user-profiles/

Download the script here

2 thoughts on “PowerShell Script: Check user profiles

  1. Melissa Williams

    The link to the script from Technet’s gallery are redirected to the main Microsoft code samples page. My attempt of using search to find the code have been unsuccessful. Can you provide me with a new link or the code?

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *