How to get the list of User Profiles in Office 365?
In SharePoint 2013/Office 365 Environment, if you want to get the list of user Profiles properties ,here is the CSOM code to achieve it. You should use QUERY API’s to achieve the same.In this instance, we are fetching the properties such as WorkEmail, PreferredName, WorkEmail with the help of Search Query API’s
var clientContext = new SP.ClientContext.get_current();
var keywordQuery = new Microsoft.SharePoint.Client.Search.Query.KeywordQuery(clientContext);
keywordQuery.set_queryText(searchTerm);
keywordQuery.set_sourceId(“B09A7990-05EA-4AF9-81EF-EDFAB16C4E31”);
keywordQuery.set_rowLimit(“2000”);
var properties = keywordQuery.get_selectProperties();
properties.add(“WorkEmail”);
properties.add(“PreferredName”);
properties.add(“JobTitle”);
var searchExecutor = newMicrosoft.SharePoint.Client.Search.Query.SearchExecutor(clientContext);
var results = searchExecutor.executeQuery(keywordQuery);
Happy SharePointing !! Hope it helps everyone.