Share via


Hosted Exchange::CreateConsumerUser

Creates a consumer user with attributes based on a specified service plan.

Arguments

Input argument Required Description

<container>

Yes

A valid Lightweight Directory Access Protocol (LDAP) path of the OU where the new user will be created. For example LDAP://OU=alpineskihouse,OU=Reseller1,OU=Hosting,DC=fabrikam,DC=Com.

<userPrincipalName>

Yes

The User principal name of the user. Typically this would be <user>@<SMTPDomain> to enable UPN login to e-mail account with the user's e-mail address.

<sAMAccountName>

Yes

The sAMAccountName.

Dd252128.note(en-us,TechNet.10).gifNote
Unlike the CreateBusinessUser procedure, the sAMAccountName is not subject to an algorithm to create a unique value. The procedure will take whatever is entered and throw an error if it is not unique.

sAMAccountName cannot be longer than 20 characters. See SAM-Account-Name Attribute for more information.

<preferredDomainController>

Yes

<planName>

No

Defines which Exchange Mailbox service plan to apply to the user.

<mailStore>/<serverName>

No

The name of a server to allocate a user's mailbox to. If this optional parameter is present then <mailStoreName> must also be present. The mail store must be defined as a consumer mail store in resource management.

<mailStore>/<mailStoreName>

No

The name of a mailstore to allocate a user's mailbox to. If this optional parameter is present then <serverName> must also be present. The mail store must be defined as a consumer mail store in resource management.

Dd252128.note(en-us,TechNet.10).gifNote
The procedure uses the optional <planName> element to determine whether it should create a mailbox for the user by calling Hosted Exchange::CreateMailbox.

<newPassword>

No

If present the procedure will set the new user's password with the value of this element. All domain password policy restrictions apply.

<displayName>

No

<givenName>

No

<middleName>

No

<sn>

No

Surname of the user.

<initials>

No

<description>

No

<properties>

No

Any valid Active Directory properties for object class user.

<proxyAddresses>

No

Additional proxy addresses for the user. Ignored if planName not provided.

Dd252128.note(en-us,TechNet.10).gifNote
The procedure will accept additional proxyAddress. However, the called Hosted Exchange::CreateMailbox procedure, which is executed when a plan is specified, adds a primary SMTP address based on the user's UPN prefix and the org's SMTP Domain (for example, user@Litwareinc.com). Furthermore, at creation time, the user will only be able to use proxyAddresses that contain the domain of their consumer organization. Additional Vanity Domains and proxy addresses based on these domains can be added with the procedures CreateConsumerVanityDomain and CreateSMTPProxyAddress.

<alias>

No

The procedure will accept this as an optional parameter. Other wise an alias will be generated from the UPN prefix (for example, user from user@litwareinc.com).

Output Arguments

  • The <user> tag containing the user object created.

  • If CreateMailbox was called, the <mail>, <proxyAddresses> and <properties> nodes are merged with output to show specific settings that occurred as a result of the requested service plan.

Remarks

Security

  • Impersonate caller.

  • Caller is tested for UserCreator role.

Sample Code

Example XML Request

<request>   
        <procedure>     
                <execute namespace="Hosted Exchange" procedure="CreateConsumerUser" impersonate="1">       
                        <executeData>         
                                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>        
                                <container>LDAP://OU=litwareinc,OU=WH,OU=Hosting,DC=fabrikam,DC=Com</container>         
                                <userPrincipalName>bob@litwareinc.com</userPrincipalName>         
                                <sAMAccountName>bob</sAMAccountName>         
                                <displayName>Bob Smith</displayName>         
                                <givenName>Bob</givenName>         
                                <middleName>John</middleName>         
                                <sn>Smith</sn>         
                                <initials>bjs</initials>             
                                <newPassword do-not-log="1">Pass1Word</newPassword>         
                                <description>user</description>         
                                <planName>BaseMail</planName>         
                                <properties>           
                                        <property name="otherHomePhone">             
                                                <value>2065551212</value>             
                                                <value>2065551213</value>           
                                        </property>           
                                        <property name="street">1703 NE 91st</property>         
                                </properties>        
                        </executeData>       
                        <after source="executeData" destination="data" mode="merge"/>     
                </execute>   
        </procedure> 
</request>

Extended XML Usage

Specify a specific mailstore.

<request>   
        <procedure>     
                <execute namespace="Hosted Exchange" procedure="CreateConsumerUser"  impersonate="1">       
                        <executeData>         
                                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>         
                                <container>LDAP://OU=litwareinc,OU=WH,OU=Hosting,DC=fabrikam,DC=Com</container>         
                                <userPrincipalName>bob@litwareinc.com</userPrincipalName>         
                                <sAMAccountName>bob</sAMAccountName>         
                                <displayName>Bob Smith</displayName>         
                                <givenName>Bob</givenName>         
                                <middleName>John</middleName>         
                                <sn>Smith</sn>         
                                <initials>bjs</initials>         
                                <newPassword do-not-log="1">Pass1Word</newPassword>         
                                <description>user</description>         
                                <planName>BaseMail</planName>        
                                <mailStore>            
                                        <serverName>EXBE02</serverName>          
                                        <mailStoreName>ConsumerMailStore1</mailStoreName>     
                                </mailStore>         
                                <properties>           
                                        <property name="otherHomePhone">             
                                                <value>2065551212</value>             
                                                <value>2065551213</value>           
                                        </property>           
                                        <property name="street">1703 NE 91st</property>         
                                </properties>        
                        </executeData>       
                        <after source="executeData" destination="data" mode="merge"/>     
                </execute>   
        </procedure> 
</request>

Example XML Response

<response>   
        <data>     
                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>     
                <container>LDAP://OU=litwareinc2,OU=WH,OU=Hosting,DC=fabrikam,DC=Com</container>     
                <userPrincipalName>bob2@litwareinc2.com</userPrincipalName>     
                <sAMAccountName>bob2</sAMAccountName>    
                <displayName>Bob Smith</displayName>     
                <givenName>Bob</givenName>     
                <middleName>John</middleName>     
                <sn>Smith</sn>     
                <initials>bjs</initials>     
                <newPassword do-not-log="1">Pass1Word</newPassword>     
                <description>user</description>     
                <planName>BaseMail</planName>     
                <properties>       
                        <property name="otherHomePhone">         
                                <value>2065551212</value>         
                                <value>2065551213</value>       
                        </property>       
                        <property name="street">1703 NE 91st</property>       
                        <property name="msExchQueryBaseDN">CN=bob2@litwareinc2.com,OU=litwareinc2,OU=WH,OU=Hosting,DC=fabrikam,DC=com</property>       
                        <property name="mail">bob2@litwareinc2</property>       
                        <property name="msExchMailboxFolderSet">         
                                <value>98821</value>       
                        </property>       
                        <property name="showInAddressBook"  mode="append">         
                                <value>CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=fabrikam,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=fabrikam,DC=com       
                        </property>       
                        <property name="msExchUserAccountControl">0</property>     
                </properties>     
                <mail>       
                        <disablePOP>0</disablePOP>      
                        <size>10000</size>       
                        <disableIMAP>0</disableIMAP>       
                        <disableHTTP>0</disableHTTP>     
                </mail>     
                <proxyAddresses>       
                        <value>bob2@litwareinc2</value>     
                </proxyAddresses>     
                <user path="LDAP://AD01.fabrikam.COM/cn=bob2@litwareinc2.com,OU=litwareinc2,OU=WH,OU=Hosting,DC=fabrikam,DC=Com" name=""/>   
        </data> 
</response> 

Applies To

Hosted Exchange Namespace API for:

  • Hosted Messaging and Collaboration version 3.5

  • Hosted Messaging and Collaboration version 3.0

See also

Tasks

Hosted Exchange::DeleteConsumerUser