Use the ModifyUser procedure of the Managed Active Directory namespace to modify a user's account.
This procedure expects to be called with impersonate="1". The procedure impersonates the caller.
<request>
<procedure>
<execute namespace="Managed Active Directory" procedure="ModifyUser">
<executeData>
<user>LDAP://CN=myUser1,CN=Users,DC=contoso,DC=com</user>
<userPrincipalName>upnMyUser1</userPrincipalName >
<sAMAccountName>myUser1</sAMAccountName>
<displayName>John Smith</displayName>
<givenName>John</givenName>
<middleName>Joe</middleName>
<sn>Smith</sn>
<initials>JS<initials>
<description>Reseller description</description>
<properties>
<property name="otherHomePhone" mode="append">
<value>425-555-1212</value>
<value>206-555-1212</value>
</property>
<property name="userAccountControl">512</property>
<property name="showInAdvancedViewOnly">
<value xmlns:dt="urn:schemas-microsoft-com:datatypes"
dt:dt="boolean">1</value>
</property>
</properties>
<preferredDomainController>myPrimaryDC.contoso.com
</preferredDomainController>
</executeData>
</execute>
</procedure>
</request>
The following input is valid for this request:
Use the <user> element to, specify the Lightweight Directory Access Protocol (LDAP) path of the user you want to modify.
<user>LDAP://LDAP path of the user</user>
By using the <userPrincipalName> element, you can specify the new universal principal name for the user.
This information is optional.
<userPrincipalName>universal principal name of user</userPrincipalName>
By using the <sAMAccountName> element, you can specify the new SAM account name for the user.
This information is optional.
<sAMAccountName>new SAM account name</sAMAccountName>
In the <givenName> element, the <middleName> element, the <sn> element, and <initials> element, you can change the user's first name, surname, middle name, and initials.
This information is optional.
<givenName>user's modified first name</givenName>
<middleName>user's modified middle name</middleName>
<sn>user's modified last name</sn>
<initials>user's modified initials name</initials>
By using the <displayName> element, you can specify a new name to display for the user.
This information is optional.
<displayName>new name to display for this user</displayName>
By using the <description> element, you can specify a new description for the user.
This information is optional.
<description>modified description for the user</description>
By using the <properties> element, you can add, modify, or append to existing properties.
This information is optional.
<properties>
<property name="otherHomePhone" mode="append">
<value>additional phone number</value>
<value>second additional phone number</value>
</property>
<property name="userAccountControl">
user account control number
</property>
</properties>
By using the <preferredDomainController> element, you can specify the domain controller that you want to use for this request. Using a single preferred domain controller eliminates replication delays that arise between multiple controllers.
This information is optional.
<preferredDomainController>your domain controller</preferredDomainController>
The response to this procedure does not contain significant data.
Important