Get all the social tag terms for a specified URL using SharePoint 2010 web service in powershell

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:

 
##Get all the social tag terms for a specified URL using SharePoint 2010 web service in powershell
$uri="http://serverName:10736/sites/ECT/_vti_bin/SocialDataService.asmx?wsdl"
## $maximumItemsToReturn is of type System.Nullable(Of Int32) which specifies the maximum number of terms to return.
## This value must be null, or nonnegative and less than 3001. If null or zero, this method returns up to 1000 social tag terms.
$maximumItemsToReturn=0
## $urlFolder is a string which contains the URL from which the social terms are retrieved
$urlFolder="http://serverName:10736/sites/ECT/Shared%20Documents/123.docx"

## Web Service Reference - http://Site/_vti_bin/SocialDataService.asmx
$socialDataServiceWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential

$SocialTermDetail=$socialDataServiceWebServiceReference.GetAllTagTermsForUrlFolder($urlFolder,$maximumItemsToReturn)
## $SocialTermDetail is of Type: [SocialDataService Web service].SocialTermDetail()
## [SocialDataService Web service].SocialTermDetail() - Refer http://msdn.microsoft.com/en-us/library/websvcsocialdataservice.socialtermdetail.aspx


foreach($tagTerm in $SocialTermDetail)
{
write-host -ForegroundColor Green "Social tag terms : "
## $tagTerm.Term - used to get or set the social tag term
$tagTerm.Term
write-host -ForegroundColor Green "Number of social data elements that contain the Term for the given results:"
##$tagTerm.Count - Used to get or set number of social data elements that contain the Term for the given results
$tagTerm.Count
}


Output:

output.jpg