Update the user information 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:

 
## Update the user information using SharePoint 2010 web service in powershell
$uri="http://serverName:10736/sites/ECT/_vti_bin/UserGroup.asmx?wsdl"
## $userName is a string that contains the user name(domainName\userName)
[
String]$userName ="domainName\userName";
## $newDisplayName is a string that contains the new display name
[
String]$newDisplayName="VijaiAnandRamalingam";
## $newUserEmail is a string that contains the users new mail id
[
String]$newUserEmail="[email protected]";
## $newNotes is a string that contains the notes for the user
[
String]$newNotes="My notes updated using SharePoint 2010 web service in powershell";
## Web Service Reference - http://Site/_vti_bin/UserGroup.asmx
$usergroupWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential
$usergroupWebServiceReference.UpdateUserInfo($userName,$newDisplayName,$newUserEmail,$newNotes)


Using the above script you could be able to update the user information like display name, email address and the notes for the specified user.




Ebook Download
View all
Learn
View all