Steps Involved:
  1. Open SharePoint 2010 Management Shell by going to Start | All Programs | SharePoint | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell (Run as Administrator).
  2. Run the following script.

Powershell Script:

  1. ##Get all the social comments created by the specific user using SharePoint 2010 web service in powershell
  2. $uri="http://serverName:10736/sites/ECT/_vti_bin/SocialDataService.asmx?wsdl"
  3. ## $userAccountName is a string that contains the specific account name
  4. $userAccountName="rd\ktzh955"
  5. ## $maximumItemsToReturn is used to specify the maximum number of comments to return.
  6. ## This value must be null, or nonnegative and less than 1001.
  7. ## If null or 0, this method returns up to 1000 social comments
  8. $maximumItemsToReturn=0
  9. ## $startIndex is used to specify the zero-based index of the total set of social comments at which the returned set of social comments starts
  10. $startIndex=0
  11. ## Web Service Reference - http://Site/_vti_bin/SocialDataService.asmx
  12. $socialDataServiceWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential
  13. $SocialCommentDetail=$socialDataServiceWebServiceReference.GetCommentsOfUser($userAccountName,$maximumItemsToReturn,$startIndex)
  14. ## $SocialCommentDetail is of Type: [SocialDataService Web service].SocialCommentDetail()
  15. ##[SocialDataService Web service].SocialCommentDetail() - Refer http://msdn.microsoft.com/en-us/library/websvcsocialdataservice.socialcommentdetail_members.aspx
  16. foreach($comment in $SocialCommentDetail)
  17. {
  18. write-host -ForegroundColor Green "Social Comment : " $comment.Comment
  19. write-host -ForegroundColor Green "-----------------------------------"
  20. ## SocialCommentDetail.Comment property is used to get the body of the social comment.
  21. write-host -ForegroundColor Yellow "Comment : " $comment.Comment
  22. ## SocialCommentDetail.IsHighPriority property is used to indicate the priority level of the social comment.
  23. write-host -ForegroundColor Yellow "IsHighPriority : " $comment.IsHighPriority
  24. ## SocialCommentDetail.Url property is used to get the URL to the social data.
  25. write-host -ForegroundColor Yellow "Url : " $comment.Url
  26. ## SocialCommentDetail.Owner property is used to get the user associated with the social data.
  27. write-host -ForegroundColor Yellow "Owner : " $comment.Owner
  28. ## SocialCommentDetail.LastModifiedTime property is used to get date and time when the social data was last modified.
  29. write-host -ForegroundColor Yellow "LastModifiedTime : " $comment.LastModifiedTime
  30. ## SocialCommentDetail.Title property is used to get the title of the social data.
  31. write-host -ForegroundColor Yellow "Title : " $comment.Title
  32. }



Output:


output.jpg