Creating a Storage Group

Storage groups are used for physically breaking your databases up into smaller management groups. This is done for several reasons. Chief among them are so you have more numerous but smaller databases, a logical organization of mailboxes, or faster Exchange backups and restores. The Exchange Server can run one simultaneous backup for each storage group. So if you have 10 databases spread across two storage groups, you can have two backups running in parallel; if you have 10 databases spread across five storage groups, you can have five backups running in parallel.

Depending on the version (Standard versus 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 them. If you create more databases or storage groups than allowed by your version, the additional databases will not mount.

Storage groups are represented in Active Directory by the msExchStorageGroup class. This class has several attributes that have fairly intuitive string values and names and can be matched up to the options in ESM. Unfortunately, the raw Active Directory objects and attributes and their valid values for Exchange are not well documented. You can experiment with their settings, but do so only in a lab environment.

Using a command-line interface

A bad aspect of creating storage groups by direct Active Directory object manipulation is that you will not get warnings concerning the maximum number of storage groups allowed.

Using VBScript

The process of calling the CDOEXM interfaces to create storage groups is rather straightforward once you have the URL for the object’s location in Active Directory. In this solution, to get the storage group container’s distinguished name for the server, the script loops through all storage groups on the sever and sets strTemp to the URL value of the last storage group. This value is then parsed to get the parent container for the storage groups to build the new storage group URL.

Using a graphical user interface

  1. Open the Exchange System Manager (ESM) snap-in.
  2. In the left pane, browse to the server that you want to create a new storage group for.
  3. Right-click on the server and select New -> Storage Group.
  4. Enter a name, transaction log location, system path location for storage of temporary and recovered files, and click OK.

Using a command-line interface

First, create an LDIF file called add_sg.ldf with the following contents:

dn: CN=<Storage Group Name>,<ParentDN>changetype: add

objectClass: msExchStorageGroup

cn: <Storage Group Name>

showInAdvancedViewOnly: TRUE

systemFlags: 1610612736

msExchESEParamEnableIndexChecking: TRUE

msExchESEParamEnableOnlineDefrag: TRUE

msExchESEParamSystemPath: <Path to store system files>

msExchESEParamPageFragment: 8

msExchESEParamPageTempDBMin: 0

msExchRecovery: TRUE

msExchESEParamZeroDatabaseDuringBackup: 0

msExchESEParamBaseName: E01

msExchESEParamCircularLog: 0

msExchESEParamEventSource: MsExchangeIS

msExchESEParamCheckpointDepthMax: 20971520

msExchESEParamCommitDefault: 0

msExchESEParamLogFilePath: <Path to log files>

msExchESEParamDbExtensionSize: 256

msExchESEParamLogFileSize: 5120

Replace <Storage Group Name> with the name of the storage group, <ParentDN> with the distinguished names of the storage groups container for the appropriate server, <Path to store system files> with the filesystem path where you want system files (temporary and recovered files), and <Path to log files> with the filesystem path where you want exchange log files. Then run the following command:

>ldifde -i -f add-sg.ldf

Using VBScript

' This code creates a Storage Group.' ------ SCRIPT CONFIGURATION ------

strServer = "<Exchange Server>"      ' e.g., ExchServer2

strName   = "<Storage Group Name>"   ' e.g., SG1

strPath   = "<File Path>" & strName  ' e.g., D:\Program Files\ExchSrvr

' ------ END CONFIGURATION ---------' Create URL to Storage Group

Set objSrv = CreateObject("CDOEXM.ExchangeServer")

objSrv.DataSource.Open strServer

' This for loop is a bit of a hack to retrieve the first Storage Group

' in the collection. VBScript doesn't let you access specific elements

' of a collection the way Jscript can.

for each strSg in objSrv.StorageGroups

strTemp = strSg

exit for

next

strTemp = mid(strTemp,instr(2,strTemp,"cn",1))

strSGUrl = "LDAP://cn=" & strName & "," & strTemp

' Create/configure Storage Group and save it

set objSG = CreateObject("CDOEXM.StorageGroup")

objSG.MoveSystemFiles(strPath)

objSG.MoveLogFiles(strPath)

objSG.DataSource.SaveTo strSGUrl

Wscript.Echo "Successfully created storage group."