SharePoint 2013 active directory import

SharePoint 2013 has an easy to setup option to import user profiles into SharePoint. It’s one-way from AD to SharePoint, but it’s far more easy to implement than the full profile synchronization using FIM. It does have one drawback. Missing profiles from import are not automatically deleted and those profiles seem only to be marked as missing after a full synchronization. And to make it a bit more difficult, a full profile sync cannot be scheduled.

I’ve created the following PowerShell script to start a full profile sync, wait for it to be finished, and than purge the missing profiles from the database.

You can schedule this script to run every day.Please know that the purging of profiles takes some time to process. So schedule your search application some time after you run this script to remove the users from the search database.

If anybody has a better solution, or thinks this is not the right way to do this, please comment below.

Leave a Reply

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