You may not be able to use Microsoft Provisioning System to programmatically create a mailbox (870933)



The information in this article applies to:

  • Microsoft Exchange Server 2003 Enterprise Edition
  • Microsoft Exchange Server 2003 Standard Edition
  • Microsoft Provisioning System

SYMPTOMS

If you are using Microsoft Exchange Server 2003 and Microsoft Provisioning System to programmatically create a new mailbox, you may not be able to create the new mailbox. You receive the following error message:

"Error Type: Provisioning.MPFProcessController.1 (0x80070057) <response><data><alias>aaaaa</alias><password>aaaaa</password></data><errorContext description="The value is out of range. ID no: c1032226 Microsoft CDO for Exchange Management/SetQuotaForUser failed for this user. Contact SA." code="0x80070057" executeSeqNo="4"><errorSource namespace="Exchange Provider" procedure="CreateMailbox"/><errorSource namespace="tstMPSNS" procedure="CreateMail"/></errorContext></response> /tstMPS/create.asp, line 25"

CAUSE

This behavior occurs because the Exchange provider for Microsoft Provisioning System includes a mailbox size limit. You cannot create new mailboxes that are larger than 400 megabytes (MB). The Exchange provider for Microsoft Provisioning System uses Collaboration Data Objects (CDO) to create mailboxes.

WORKAROUND

To work around this issue, use one of the following methods:
  • Create the mailbox with a smaller size.
  • Use the sample code that will reset the mailbox size.
    Note The sample code combines three procedure calls to reset a user's mailbox size and quotas.

The procedure calls are:
  1. The code obtains the current allocation of the user's mailbox from Resource Manager (RM). RM is a feature of Microsoft Provisioning System.
  2. The code reallocates the mailbox to the new size in RM.
  3. The code sets the user's quota attributes by using the ModifyUser procedure from the Managed Active Directory namespace.
This sample code does not log anything to the event table. This sample code currently works for Microsoft Exchange Server 2003 users only.

Sample code

The following is the sample XML code. Variables such as user path, size, warningQuota, and prohibitSendAndRecieveQuota are set in the procedure data block of the request.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

<request xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <procedure xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
  <procedureData>
    <!--LDAP path of user-->
    <path>LDAP://CN=user@AlpineSkiHouse.com,OU=AlpineSkiHouse,OU=ConsolidatedMessenger,OU=Hosting,DC=Fabrikam,DC=Com</path>
    <!--preferred domain controller-->
    <preferredDomainController>AD01.Fabrikam.Com</preferredDomainController>
    <!--Mailbox settings-->
    <mail>
      <!-- All values are in kilobytes.-->
      <size>600000</size>
      <warningQuota>540000</warningQuota>
      <prohibitSendAndRecieveQuota>700000</prohibitSendAndRecieveQuota>
    </mail>
    <previousAllocation/>
  </procedureData>
  <!--Obtain the current RM allocation for the specified user.--> 
    <execute namespace="Exchange Resource Manager Ex" procedure="QueryMailboxAllocation" impersonate="1">
      <executeData>
        <mailbox/>
      </executeData>
      <before source="procedureData"
              sourcePath="preferredDomainController"
              destination="executeData"/>
      <!-- Mailbox path -->
      <before source="procedureData"
              sourcePath="path"
              destination="executeData"
              destinationPath="mailbox"
              mode="merge"/>
      <!-- Size of allocation in kilobytes -->        
       <after source="executeData"
              sourcePath="mailbox/kilobytes"
              destination="procedureData"
              destinationPath="previousAllocation"
              mode="merge"/> 
    </execute>
  <!--Reallocate the mailbox. -->       
    <execute namespace="Exchange Resource Manager Ex" procedure="ReallocateMailbox" impersonate="1">
      <executeData>
        <mailbox />
      </executeData>
      <!-- preferred domain controller -->
      <before source="procedureData" 
              sourcePath="preferredDomainController"
              destination="executeData" />
      <!-- Mailbox path -->
      <before source="procedureData" 
              sourcePath="path"
              destination="executeData" 
              destinationPath="mailbox"
              mode="merge" />
      <!-- Create new allocation. -->
      <before source="procedureData" destination="executeData"
              destinationPath="kilobytes" mode="merge">
         <xsl:template match="*">
          <kilobytes><xsl:value-of select="number(mail/size) - number(previousAllocation)"/></kilobytes>
         </xsl:template>        
      </before>
    </execute>
  <!--Modify the user. -->       
    <execute namespace="Hosted Exchange" procedure="ModifyUser" 
        impersonate="1">
      <executeData/>
      <!-- preferred domain controller -->
      <before source="procedureData" 
              sourcePath="preferredDomainController"
              destination="executeData" />
      <!-- mailbox path -->
      <before source="procedureData" 
              sourcePath="path"
              destination="executeData" />
      <!-- quota settings-->
      <before source="procedureData" 
              destination="executeData">
          <xsl:template match="*">
            <properties>
              <property name="mDBStorageQuota">
                <value><xsl:value-of select="mail/warningQuota"/></value>
              </property>
              <property name="mDBOverQuotaLimit">
                <value><xsl:value-of select="mail/size"/></value>
              </property>
              <property name="mDBOverHardQuotaLimit">
                <value><xsl:value-of select="mail/prohibitSendAndRecieveQuota"/></value>
              </property>
            </properties>
          </xsl:template>        
      </before>
      <after source="procedureData" destination="data" mode="merge"/>
    </execute>
  </procedure>
</request>

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MinorLast Reviewed:11/10/2005
Keywords:kbBug kbtshoot KB870933 kbAudITPRO