Get all the social tag term URL's for the specified tag keyword 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 term URL's for the specified tag keyword using SharePoint 2010 web service in powershell
$uri="http://serverName:10736/sites/ECT/_vti_bin/SocialDataService.asmx?wsdl"
## $guid is of type System.Guid which contains the ID of the social tag term
$keyword="Tag2"
## Web Service Reference - http://Site/_vti_bin/SocialDataService.asmx
$socialDataServiceWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential

$SocialUrlDetail=$socialDataServiceWebServiceReference.GetAllTagUrlsByKeyword($keyword)
## $SocialUrlDetail is of Type: [SocialDataService Web service].SocialUrlDetail()
##[SocialDataService Web service].SocialUrlDetail() - Refer http://msdn.microsoft.com/en-us/library/websvcsocialdataservice.socialurldetail_members.aspx


foreach($tagURL in $SocialUrlDetail)
{
write-host -ForegroundColor Green "Tag URL's : "
## $tagURL.Url - used to get or set the URL that is associated with the SocialUrlDetail
$tagURL.Url
write-host -ForegroundColor Green "Count: "
##$tagURL.Count - Used to get or set number of social data that is associated with the URL
$tagURL.Count
}


Output:

output.jpg





Ebook Download
View all
Learn
View all