i want to programatically fetch all users(list of users) who have a tagged a sharepoint 2010 custom list item "i like it".

this thread shows how to get count of user who have tagged a list item with "I Like it"

but i want list of users // sharepoint provide this functionality out of the box in central admin for this follow this link

is there any way to fetch this information programatically ??

thanks in advance!!

3 Answers 3


While I'm sure folks will assert that querying the database in any form is not allowed (i.e. will affect your Microsoft supportability), I will challenge them ahead of time to produce anything officially from Microsoft with such a statement. All kinds of stuff on inserting/modifying/deleting rows in tables and altering the scheme, but nothing on performing a select statement or executing a stored procedure that doesn't update the table contents in any way.

I will say that directly querying the database is something that should be done by folks that a) understand SQL and how it optimizes queries and b) understand the SharePoint DM. You don't want folks writing queries that will have a measurable negative impact on a farm's performance.

With that disclaimer out of the way, there is no OOB means of getting to this data via a published and supported API that I am aware of. You could get to it by stringing a few of the Social DB's stored procedures together, but it's kind of cumbersome. The following is a Select that will get you most of the way. You would still need to link it to your Profile DB to resolve the GUID to a profile name...you could alternately tzake the GUID and call UserProfileManager.GetUserProfile to return a reference to the profile and get the name that way.

FROM [Social DB].[dbo].[SocialTags] st 
  Inner Join [Social DB].[dbo].[Urls] u 
    On u.UrlId = st.UrlId 
    and u.Url = 'http://sharepointdev:9000/Shared%20Documents/Content_viewing_2011-07-26T131806.xlsx' -- the encoded URL of the file you want to retrieve Like It info on
  Inner Join [Social DB].[dbo].[UserProfile_Validation] uv 
    On uv.User_RecordID = st.User_RecordID
  InputTermLabel = 'I like it' -- or you can get the TermID for the "I Like It" tag and query against TermID

Not a perfect solution by any stretch of the imagination and one that will obviously require re-certification if any hotfixes, CU, or SPs are installed.


In the first post, have you tried enumerating the List<SocialTermDetail> list to see what's in each object in the list?

  • List<SocialTermDetail> it contains all the tags associated with the list item ...... but it does not give any informaion about the users who have added the tag to it , except the tag owner who has created the tag for the first time in the in term store. Commented Mar 24, 2011 at 18:02

In this magazine: http://www.diwug.nl/e-magazines/pages/default.aspx eMagazine #4 I wrote an article about the SocialDataService, UserProfile, Users and Groups and the Search web service. I guess this will help you.

  • The link you've provided doesn't exist anymore. Can you please update the link if the article is still available somewhere else?
    – mvark
    Commented Dec 31, 2012 at 11:04
  • Updated the link. Commented Jan 2, 2013 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.