Creating Multiple Storage Groups & Databases
We have a CCR Exchange 2007 deployment that we need to create multiple storage groups and stores in alphabetical order A,B,C...Z. The Logs will reside on one drive and the databases on another.
Considering that you have to create the storage group and database, then move the paths manually using the Shell, this is going to be a tedious task. Is there a simpler way to get this accomplished using PowerShell?
Thanks in advance.
J.
December 10th, 2008 6:11am
When you create a new Storage Group, you will see that the summary page at the end has the PowerShell script specified. The same happens when you create a Mailbox database.
So, I copied the code, and created a script in Notepad that was similar to the following;
Code Snippet
new-StorageGroup -Server 'ServerMX3' -Name 'Adelaide Mailboxes A-B' -LogFolderPath 'L:\Exchange\ADL\A-BLogs' -SystemFolderPath 'D:\Exchange\ADL\A-B'new-StorageGroup -Server 'ServerMX3' -Name 'Adelaide Mailboxes C-D' -LogFolderPath 'L:\Exchange\ADL\C-DLogs' -SystemFolderPath 'D:\Exchange\ADL\C-D'new-StorageGroup -Server 'ServerMX3' -Name 'Adelaide Mailboxes E-G' -LogFolderPath 'L:\Exchange\ADL\E-GLogs' -SystemFolderPath 'D:\Exchange\ADL\E-G'...
new-mailboxdatabase -StorageGroup 'ServerMX3\Adelaide Mailboxes A-B' -Name 'MailboxesA-B' -EdbFilePath 'D:\Exchange\ADL\A-B\MailboxA-B.edb'new-mailboxdatabase -StorageGroup 'ServerMX3\Adelaide Mailboxes C-D' -Name 'MailboxesC-D' -EdbFilePath 'D:\Exchange\ADL\C-D\MailboxC-D.edb'new-mailboxdatabase -StorageGroup 'ServerMX3\Adelaide Mailboxes E-G' -Name 'MailboxesE-G' -EdbFilePath 'D:\Exchange\ADL\E-G\MailboxE-G.edb'...
mount-database -Identity 'CN=MailboxesA-B,CN=Adelaide Mailboxes A-B,CN=InformationStore,CN=ServerMX3,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=DOMAINNAME,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=local'
mount-database -Identity 'CN=MailboxesC-D,CN=Adelaide Mailboxes C-D,CN=InformationStore,CN=ServerMX3,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=DOMAINNAME,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=local'
mount-database -Identity 'CN=MailboxesE-G,CN=Adelaide Mailboxes E-G,CN=InformationStore,CN=ServerMX3,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=DOMAINNAME,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=local'
I found that because I have a hyphen in my edb file name, it does not mount automatically, so I needed the script to mount the databases a few seconds after creation.
This creates the Storage Groups and the Mailstores, using D for data and L for logs.
Hope this helps.
Free Windows Admin Tool Kit Click here and download it now
December 10th, 2008 9:19am
I edited the script to my environment and got the Storage Groups created. However when it tries to create the databases I get the following error:
New-MailboxDatabase : The .edb file path, "H:\Database\A.edb", is not a valid path because it is not on a fixed drive.Parameter name: EdbFilePathAt C:\Program Files\Microsoft\Exchange Server\Scripts\storagegroups.ps1:1 char:20+ new-mailboxdatabase <<<< -Name 'A' -StorageGroup 'nygh-exchserv\A' -EdbFilePath 'H:\Database\A.edb'
Not sure what the error "not a valid path because it is not on a fixed drive" is. Don't think its the script itself however I haven't found anything relavant that points to possible problem.
Thanks,
J.
December 11th, 2008 12:25am
My mistake. The node I was running the command from was not the Active Node.
Script works fine.....Thank You.
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2008 2:46am