SharePoint 2010, get the Distinct Values of a User Profile Property?

Michael Stum
  • SharePoint 2010, get the Distinct Values of a User Profile Property? Michael Stum

    Is there any way in SharePoint 2010 to get the Distinct values of a property across all users? For example, I want a list of all Departments in the Profile Store.

    In SQL I can do

    SELECT DISTINCT(PropertyVal) FROM [ProfileDB].[dbo].[UserProfileValue]
    WHERE PropertyID = 14
    

    but accessing the SQL Database is a big no-no of course, so I wonder if there is something in the object model?

    Note that accessing the User Information List on an SPSite is not good enough, as only a fraction of all users is in that list. I want to get it directly from the Profile Store.

    I do not want to loop through UserProfileManager because a) it's sloooow and b) requires Elevated Permissions that even SPSecurity.RunWithElevatedPermissions doesn't provide.

    Before I write a timer job that does that, is there some other way to do that?

  • As far as I am aware this can only be done with choice fields. For something like the department you would likely have to iterate through the profiles.

Tags
2010 user-profile
Related questions and answers
  • { $_.GetEnumerator();} However, what I want to do is be able to return a table, or csv file of specific values in the profile, e.g. Username, WorkEmail, WorkPhone. I have tried piping the output to |ft...The following script spits out all UserProfile properties for users on Sharepoint 2007: [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles") # Function: Get-UserProfiles # Description: return a UserProfileManager object containing all user profiles

  • I have created a "Hello World" web part. When I pressed F5 in Visual Studio 2010, I got the following error. I have already got Microsoft SharePoint Foundation User Code Service started. Can anyone... you want to continue anyway? --------------------------- Yes No --------------------------- PS C:\Users\beny> Get-SPServiceInstance | format-table TypeName, Id TypeName... Application Registry Service 46e7ddc8-49af-4a7e-9eee-155f526ed509 Microsoft SharePoint Foundation User Code Service

  • , whether using the "select property values" popup or by typing directly into the field. We have several users who use Macs and therefore have no access to IE. Does anyone know how to get around this? ...We have several profile properties that are set as multivalue fields and are restricted to a list of options. Some of them are set up as Company Name Company Name - Specific Department 1 Company Name - Specific Department 2 If a user tries to select "Company Name" using a non IE browser (I've tried Chrome, Firefox & Safari), they get an error message saying "more than one matched choices

  • Is it possible to use the Content Query web part to filter on multiple specific content types that do not have a parent/child relationship? I have a requirement to show Events (from a calendar) and Announcements (from an Announcement list) aggregated in the same area but as these come from two different branches in the content type tree, I can't do this via configuration of the web part. Would I be able to do this with a custom CAML query after exporting/re-importing the web part xml? Also I noticed the following two XML clauses in the webpart.xml file: <property name="ContentTypeName

  • I want to create a new SharePoint 2010 farm using PowerShell. I use the following command: New-SPConfigurationDatabase When issuing this command (and providing the needed parameters) I get... running the "SharePoint 2010 Products Configuration Wizard" I'm able to create a farm. I have a freshly installed Windows Server 2008 R2 with SQL 2008 R2 on the same box (it's a demo box) and the SharePoint 2010 binaries installed.

  • I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I have deployed a publishing portal. It is using a custom forms authentication solution, i.e. I store user names, passwords, and user profile information in a custom (schema) SQL Server database. I am developing using VSTS 2008 + C# + .Net 3.5 + ASP.Net + SharePoint Server 2007 SDK. I want to learn how to program an integration of the user profiles stored in the database into SharePoint user profile management (so that from SharePoint all users information can have a link for a user and then the profile data

  • After following Spence Harbar's Rational Guide to implementing SharePoint Server 2010 User Profile Synchronization (http://www.harbar.net/articles/sp2010ups.aspx) exactly (and having it work several... 2010 SQL (Default Instance) SQL Server 2008 R2 64 Bit All the necessary steps in Spence's guide (domain accounts, permissions, rights, etc.) have been followed. The two FIM services on the APP... 22: The Forefront Identity Manager Service cannot connect to the SQL Database Server. This error now only exists once in the logs. The User Profile Sync service is now stuck at starting rather than

  • I am trying to sync users from our AD to SharePoint. Currently I can not start user profile import because I get the following error all the time. Error "Cannot navigate to the requested page while User Profile Synchronization is running. Please wait for the current Sychronization run to finish" The error is clear but this error is showing up all the time for a week now; is there a way to stop it or what am I doing wrong? I have restarted the server with no luck.

  • I've created a custom list in SharePoint 2010 from a custom content type (inherit from item) and I would like to give the users the option to order the items in this list - similar to how users can order items in an out of the box Links list. In SharePoint 2007 I did this several times by using the OrderedList property in the List element of the schema.xml, and I've tried the same approach in 2010. I also added the OrderedView property on the View element. After creating a list from this defintion, when I look at the list settings and attempt to modify a view then I see the options

Data information