Filter disabled user accounts from AD to SharePoint

How often do you see that disabled users from active directory appears in SharePoint.

There are scenarios you might observe disable person's details will appears in SharePoint people search, they will still show in the organization chart webpart in my site etc. Why is it so?. You (or) person who has done configuration of the user profile forgot to filter the disabled user accounts from active directory to SharePoint. To avoid the above cases you have to filter the disabled user accounts from Active Directory to SharePoint.

In this post you will learn how to filter user profile information of disabled user accounts from Active Directory to SharePoint.

To filter the disabled user accounts

Go to [Central administration]  [application management] [Manage service applications] [User profile service application]

The below Figure will appears.

User Profile Syn connections

Click on Configure synchronization connections under Synchronization section of user profile service application.

Edit connection Filters

From the connections you are using click on Edit connection filters menu.

Exclusion Filter for Users

It will open the Edit connection filters screen from that you can see Exclusion filter for users.

In Exclusion filter for users enter the below values.

Attribute : userAccountControls (Select from dropdown)

Operator: Bit on Equal (Select from dropdown)

Filter : 2

Once you enter the required values click on Add button and it will show the below details in Exclusion filter for users section.

Exclusion Filter added

Finally click on ok button to submit the Edit connection filters details. Once you are done wait for full synchronization to run or you can forcefully run(In Dev or Test or UAT environments).


› Filter disabled Users from AD to SharePoint

Join 8,000 subscribers and receive instant access to

Devendra's Library of Resources for SharePoint Developers

About Author

Devendra Velegandla is a five-time recipient of Microsoft's Most Valuable Professional (MVP) award (2014-2019) for Office Apps and Services, Office Servers and Services MVP and  SharePoint Server. He received the MCC award for his contributions in Microsoft MSDN/TechNet forums. He loves sharing articles, videos, and tutorial on SharePoint and Office 365.