Recipe 17.25. Creating a Mailbox StoreProblemYou want to create a mailbox store. The primary reason for creating additional mailbox stores is to decrease the size of the individual stores while supporting many users on one server. SolutionUsing a graphical user interface
Using VBScript' This code creates a Mailbox Store. ' ------ SCRIPT CONFIGURATION ------ strServer = "<Exchange Server>" ' e.g., ExchServer2 strSGName = "<Storage Group Name>" ' e.g., SG1 strMailStoreName = "<MailBox Store Name>" ' e.g., DB1 ' ------ END CONFIGURATION --------- ' Find Storage Group URL strSearch = "CN=" & strSGName & "," set objSrv = CreateObject("CDOEXM.ExchangeServer") objSrv.DataSource.Open strServer for each strSg in objSrv.StorageGroups if (instr(1,strSg,strSearch,1)>0) then strSGUrl = strSg next ' Generate Mailbox Store URL strMBUrl = "LDAP://CN=" & strMailStoreName & "," & strSGUrl ' Create/configure Mailbox Store and save it set objMb = CreateObject("CDOEXM.MailBoxStoreDB") objMb.DataSource.SaveTo strMBUrl ' Mount DataBase objMB.Mount Wscript.Echo "Successfully created mailbox store." DiscussionMailbox stores, which are also called mailbox databases, are where mailboxes are located. There are quite a few configuration settings for mailbox stores which are beyond the scope of this chapter, but going through the ESM GUI when manually creating a mailbox store should give you an idea of what can be configured.
Depending on the version (Standard or Enterprise) of Exchange, you can have up to four storage groups per server and up to five mailbox stores per storage group. ESM enforces these limits, but it is possible to directly modify Active Directory to exceed these limits. If you create more databases or storage groups than allowed, the additional databases will not mount. Mailbox stores are represented in Active Directory by the msExchPrivateMDB class. This class is not as simple as some of the other classes used by Exchange. In addition, several of the attributes hold binary data, so working directly with these Active Directory objects can be difficult via VBScript or command-line methods. One of the more notable attributes of the mailbox store objects is a back-link attribute called homeMDBBL. This multivalued attribute links back to all of the user objects that have mailboxes in this mailbox store.
Using a command-line interfaceDue to the binary attributes the mailbox store objects contain, they are not good candidates for the LDIFDE command-line tool. Using VBScriptThe process of calling the CDOEXM interface is rather straightforward once you have the URL for the object's location in Active Directory. As with the GUI, there are many properties that can be configured through VBScript. To get a complete list of the various methods and properties available for the MailBoxStoreDB interface, see the Exchange Server 2003 SDK. See AlsoMS KB 821748 (HOW TO: Add New Mailbox Stores in Exchange Server 2003) |