I’d like to query the user profile service and get users only by a specific property – for example by Job Title. Is there any way to do this using the client object model?
I do NOT want to query all site users collection and then filter them in-memory. Anyway to query directly the UPS – even passing a caml?
Just wanted to confirm for anyone trying to fetch Country property in SharePoint online. This is NOT possible with the client object model.
If you are using on-prem SharePoint, thenĀ you might modify the UPS to return this property, but if you are using SharePoint Online, then there is NO way to do it but to leveraging on Windows Azure APIs – you will need to:
1. Leverage on the Graph API for Azure.
2. In VS, using C#, there is a special library – just look for Microsoft.Azure.ActiveDirectory.GraphClient in NuGet packages.
3. Register your component / App as Azure App Principle using the Get-MsolServicePrincipal and Add-MsolRoleMember Azure AD cmdlets.