Add social tag to the 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:

 
 
 
##Add new tag with the specified URL for the current user using SharePoint 2010 web service in powershell
$uri="http://serverName:10736/sites/ECT/_vti_bin/SocialDataService.asmx?wsdl"
## $url is a string that contains the URL for which the tag has to be added by the specified user
$url="http://serverName:10736/sites/ECT/"
## $termId is of type System.Guid that contains the Guid of the social tag term
[
System.Guid]$termId=New-Object -TypeName System.Guid -ArgumentList "99f1203a-a456-4948-820d-559d8fdc6702"
## $isPrivate -true to indicate the social tag is private; otherwise, false. If this value is null, this method assumes false for this parameter.
$isPrivate=$false
## $title is a string that contains the title of the social tag
$title="Tag Added"


## Web Service Reference - http://Site/_vti_bin/SocialDataService.asmx
$socialDataServiceWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential
$tag=$socialDataServiceWebServiceReference.AddTag($url,$termId,$title,$isPrivate)


## $tag is of Type: [SocialDataService Web service].SocialTagDetail()
##[SocialDataService Web service].SocialTagDetail() - Refer http://msdn.microsoft.com/en-us/library/websvcsocialdataservice.socialtagdetail_members.aspx
Ebook Download
View all
Learn
View all