Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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!!

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

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.

SELECT UserId
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
Where
  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.

share|improve this answer
add comment

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.

share|improve this answer
    
The link you've provided doesn't exist anymore. Can you please update the link if the article is still available somewhere else? –  mvark Dec 31 '12 at 11:04
    
Updated the link. –  Anita Boerboom Jan 2 '13 at 13:54
add comment

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

share|improve this answer
    
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. –  Umbrella Corporation Mar 24 '11 at 18:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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