SharePoint Company Directory and People Finder with SharePoint Search and User Profiles

Use SharePoint Search and the User Profile Service to build a SharePoint Company Directory that is available to all employees of the organization. This feature is common in Intranets and can be built using only out-of the box features.

User Profiles and the User Profile Service in SharePoint

You will need to be a SharePoint Administrator to follow-along with these steps. If you’re not a SharePoint Administrator, partner up with your IT team.

The goal is to build a search for people that returns their Picture, Name, Department, and Work E-mail. Something like this:

Office 365 SharePoint Human Resources Person Result.

This information is coming from the SharePoint User Profile Service:

O365 SharePoint Human Resources get to the User Profiles.

You’ll find a variety properties that define a user (just like the properties on a document, list item, site page, etc.) after going to ‘Manage User Profiles’, and looking up a name:

Office 365 SharePoint User Profile Properties.

In order for this solution to be successful the backing data must be accurate.

For this example, SharePoint Search will be used to source: Name, Department, and Work Email (not shown in the image above) from the User Profile Service.

Building the SharePoint Company Directory Search Page

Read the blog posts on Office 365 and SharePoint – Sales Contract Lifecycle Management (CLM) if something I cover below is unclear. Here are other helpful posts on topics to read before continuing:

  • Adding pages with web parts. The subject is covered in depth…particularly in this post.
  • Keyword Query Language (KQL) and managed properties in the Content Search Web Parthere.

In advance, here’s the query we’ll use the following KQL value for the  Content Search Web Part:


Note that WorkEmail is automatically promoted to a managed property from the People content type.

O365 SharePoint User Profile Work Email as WorkEmail managed property.

The query above reads, “All results filtered by anything matching the SearchBoxQuery (even empty) and where WorkEmail contains ‘”.

So, why filter on “WorkEmail contains ‘'”? The “Select a query” filter, set to “Local People Results (System)” in the CSWP, returns the following without the WorkEmail filter.

O365 SharePoint too many results in People content type.

There are objects in SharePoint that are of the “People/Person” content type, but they are system accounts and not actual valid employees. Fortunately, they don’t have e-mail WorkEmail addresses in their user profile, and all valid employees do. Therefore, we add a filter on and see the expected results:

O365 SharePoint Human Resources valid people search results.

Now, add an ascending sort by Last Name (i.e. the LastName managed property):

O365 SharePoint Sort People results by last name.

Finally, set the Property Mappings on the “Picture on left, 3 lines on right” Display Template. Increase the number of items to show:

Company Directory CSWP settings.

Company Directory Content Search property settings.

Validate the SharePoint Company Directory and People Finder

The Company Directory and People Finder have been built using all out of the box properties and settings in the Content Search Web Part.

Below is a demonstration in a test environment with two users in the User Profile Service.

As always, there is more than one way to build this solution. You could use the standard Search Results web part as another option. That solution might need Display Templates altered to get the information you want, but it comes with features such as “related people” and the Profile Hover Panel. Here you can see a screen shot using the standard Search Results web part. This includes Name, Title, Department, “Ask me about”, Interests, and the hover panel with links to related data:

O365 SharePoint Search results company directory.

This demonstrates that you have a choice. You can build either version of the SharePoint Company Directory with standard / out-of-the-box features.

Now check out this post to complete the directory and add SharePoint “Ask Me About” and “Interests” to the results.





Categories: Business, Business Management, Human Resources, Office 365 and O365, SharePoint

Tags: , , ,

1 reply


  1. Office 365 and SharePoint – Human Resources (HR) Company Directory – User Profiles and Expertise Search Results Refiners – Westmorr Consulting

Leave a Reply