Hosted Exchange::CreateMailbox

This procedure creates an Exchange mailbox for a specified user. Both CreateConsumerUser and CreateBusinessUser call this procedure if a mailbox plan is provided with input.

The procedure creates an Exchange mailbox and sets the following properties on the user's Active Directory object:

  • msExchUserAccountControl = 0

  • showInAddressBook = LDAP of Default GAL

  • msExchQueryBaseDN = LDAP of a business user's organization or LDAP of a consumer user's Active Directory object

  • proxyAddresses/value = user's email address (user@orgname.com)

Additional properties and mailbox settings are determined by the makeup of a mailbox service plan. If the service plan contains the <showInAddressLists> attribute, this indicates that the plan includes full Outlook client capabilities. The procedure will check to see if the organization already has a GAL, AL, OAL address lists. If the lists do not exist, a sub process is executed to create them.

Arguments

Input argument Required Description

<path>

Yes

The Lightweight Directory Access Protocol (LDAP) path of user.

<planName>

Yes

A valid Exchange mailbox service plan name.

<preferredDomainController>

Yes

<customerTypeName>

No

Determines the type of resource management to use. BusinessUser and ConsumerUser are the two allowed inputs for this parameter. If not provided the procedure defaults to BusinessUser resource management.

<mailStore/@algorithm>

No

Possible values are "level" and "tightPack". Default is "tightPack". If this attribute is "tightPack", allocations are packed tightly to minimize the number of servers used. Otherwise, packing is leveled across mail stores. Leveling is recommended to facilitate upselling of services. Note that this attribute is ignored if the customerTypeName=ConsumerUser.

<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. If customerTypeName is BusinessUser the user's organization must already own storage space on the specified mailstore. If customerTypeName is ConsumerUser the mail store must be defined as a consumer mail store in Resource Manager.

<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. If customerTypeName is BusinessUser the user's organization must already own storage space on the specified mailstore. If customerTypeName is ConsumerUser the mail store must be defined as a consumer mail store in Resource Manager.

<proxyAddresses>

No

Additional proxy addresses for the user.

Dd278816.note(en-us,TechNet.10).gifNote
The procedure will accept additional proxyAddresses. This procedure, however, adds a primary SMTP address based on the user's UPN prefix and the org's SMTP Domain (e.g. user@Litwareinc.com).

<alias>

No

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

<SMTPDomain>

No

The SMTP domain to use when generating the user's primary e-mail address. If not provided, the primary SMTPDomain stored in the Customer Plan Database is used. In general this parameter should only be used for special cases where the default behavior needs to be overridden.

Output Arguments

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 tested for User Creator role.

Sample Code

Example XML Request

<request> 
        <procedure>   
                <execute namespace="Hosted Exchange" procedure="CreateMailbox"  impersonate="1">       
                        <executeData>        
                                <path>LDAP://CN=bob@bobco.com,ou=bobco,OU=Wh,OU=Hosting,DC=fabrikam,DC=Com</path>   
                      <planName>BaseMail</planName>        
                                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>   
                        </executeData>    
                        <after source="executeData" destination="data" mode="merge"/> 
                </execute>  
        </procedure> 
</request>

Extended XML Usage

Business User - specify mail store selection algorithm.

<request> 
        <procedure>    
                <execute namespace="Hosted Exchange" procedure="CreateMailbox"   impersonate="1">       
                        <executeData>      
                                <path>LDAP://CN=bob@bobco.com,ou=bobco,OU=Wh,OU=Hosting,DC=fabrikam,DC=Com</path> 
                                <planName>BaseMail</planName>         
                                <mailStore algorithm="level"/>     
                                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>   
                        </executeData>     
                        <after source="executeData" destination="data" mode="merge"/> 
                </execute> 
        </procedure>> 
</request>

Extended XML Usage

Business User - specify mail store.

<request>  
        <procedure>     
                <execute namespace="Hosted Exchange" procedure="CreateMailbox"  impersonate="1">       
                        <executeData>       
                                <path>LDAP://CN=bob@bobco.com,ou=bobco,OU=Wh,OU=Hosting,DC=fabrikam,DC=Com</path>         
                                <planName>BaseMail</planName>       
                                <mailStore>          
                                        <serverName>EXBE01</serverName>          
                                        <mailStoreName>BusinessMailStore1</mailStoreName>       
                                </mailStore>        
                                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>        
                        </executeData>      
                        <after source="executeData" destination="data" mode="merge"/>    
                </execute>  
        </procedure> 
</request>

Extended XML Usage

Consumer User - specify mail store.

<request> 
        <procedure>     
                <execute namespace="Hosted Exchange" procedure="CreateMailbox" impersonate="1">       
                        <executeData>        
                                <path>LDAP://CN=bob@litwareinc.com,ou=litwareinc,OU=consolidatedmessenger,OU=Hosting,DC=fabrikam,DC=Com</path>        
                                <customerTypeName>ConsumerUser</customerTypeName>      
                                <planName>BaseMail</planName>        
                                <mailStore>          
                                        <serverName>EXBE01</serverName>           
                                        <mailStoreName>BusinessMailStore1</mailStoreName>        
                                </mailStore>        
                                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>        
                        </executeData>       
                        <after source="executeData" destination="data" mode="merge"/>    
                </execute>  
        </procedure> 
</request>

Example XML Response

<response>   
        <data>   
                <path>LDAP://CN=user@alpineskihouse.com,ou=alpineskihouse,OU=Wh,OU=Hosting,DC=fabrikam,DC=Com</path>  
                <planName>BaseMail</planName>     
                <preferredDomainController>AD01.fabrikam.com</preferredDomainController>   
                <properties>       
                        <property name="msExchQueryBaseDN">OU=alpineskihouse,OU=WH,OU=Hosting,DC=fabrikam,DC=com</property>      
                        <property name="mail">user@alpineskihouse.com</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</value>     
                        </property>      
                        <property name="msExchUserAccountControl">0</property>   
                </properties>     
                <mdb>BusinessMailstore1</mdb>     
                <server>EXBE02</server>   
                <path>LDAP://AD01.fabrikam.COM/CN=user@alpineskihouse.com,ou=alpineskihouse,OU=Wh,OU=Hosting,DC=fabrikam,DC=Com</path>     
                <alias>user</alias>`   
                <queryBase>OU=alpineskihouse,OU=WH,OU=Hosting,DC=fabrikam,DC=com</queryBase>    
                <proxyAddresses>      
                        <value>user@alpineskihouse.com</value>   
                </proxyAddresses>    
                <mail>       
                        <disableIMAP>0</disableIMAP>      
                        <disablePOP>0</disablePOP>      
                        <disableHTTP>0</disableHTTP>      
                        <size>10000</size>     
                </mail>   
        </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::CreateMailboxPlan