UserProfileService.ModifyUserPropertyByAccountName Method
Modifies a user profile property for the specified account name.
Namespace: websvcUserProfileService
Assembly: MOSSSOAP (in MOSSSOAP.dll)
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://microsoft.com/webservices/SharePointPortalServer/UserProfileService/ModifyUserPropertyByAccountName", RequestNamespace := "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService", _
ResponseNamespace := "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub ModifyUserPropertyByAccountName ( _
accountName As String, _
newData As PropertyData() _
)
'Usage
Dim instance As UserProfileService
Dim accountName As String
Dim newData As PropertyData()
instance.ModifyUserPropertyByAccountName(accountName, _
newData)
[SoapDocumentMethodAttribute("https://microsoft.com/webservices/SharePointPortalServer/UserProfileService/ModifyUserPropertyByAccountName", RequestNamespace = "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
ResponseNamespace = "https://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void ModifyUserPropertyByAccountName(
string accountName,
PropertyData[] newData
)
Parameters
- accountName
Type: System.String
Account name of the user.
- newData
Type: []
New property name and values.
Remarks
The following example shows how to modify the first name of a user.
Make sure you add a Web reference to a UserProfileService Web service site you have access to. Change the using ModifyUserPropertyByNameSample.MyServer002; directive to point to the Web service site you are referencing. In addition, replace "domain\\username" with valid values.
Examples
using System;
using System.Collections.Generic;
using System.Text;
// TODO
// Change the using ModifyUserPropertyByNameSample.MyServer002 directive
// to point to the Web service you are referencing.
using ModifyUserPropertyByNameSample.MyServer002;
namespace ModifyUserPropertyByNameSample
{
class Program
{
static void Main(string[] args)
{
//Instantiate the Web service.
UserProfileService userProfileService =
new UserProfileService();
//Set credentials for requests.
//Use the current user log-on credentials.
userProfileService.Credentials =
System.Net.CredentialCache.DefaultCredentials;
PropertyData[] newdata = new PropertyData[1];
newdata[0] = new PropertyData();
newdata[0].Name = "FirstName";
newData[0].IsValueChanged = true;
newdata[0].Values = new ValueData[1];
newdata[0].Values[0] = new ValueData();
newdata[0].Values[0].Value = "";
// TODO
// Replace "domain\\username" with valid values.
userProfileService.ModifyUserPropertyByAccountName
("domain\\username", newdata);
}
}
}