Thursday, December 13, 2012

Exchange 2010 Initial Database Setup

Here's a quick how-to on Exchange 2010 addressing a couple common problems:

Assumptions:

You have completed Exchange 2010 setup and not yet migrated mailboxes to it.

You want to create one or more mailbox databases and delete the default. (The default names make it more difficult to manage)

You have more than one domain controller (See point 2 below)

You are executing commands directly on the server in question. (You can do it remotely, but the syntax of the commands is different)

Steps:

First things first, let's create your new database. Pick an appropriate name and open up the Exchange Management Shell (as admin)

Most Exchange 2010 setups I've been through have been subject the error detailed here. Though the article talks about a multiple domain environment it may still appear in a single domain setup. It is due to the replication delay between your domain controllers. For this reason, I've found that keying your preferred server can alleviate this and a few other issues. Long story short, pick your best (local) domain controller, and execute: Set-ADServerSettings -PreferredServer DC.FQDN.Here . If you would like to see the DC configuration, you can use the command Get-ADServerSettings | Format-List .

Now make the DB by using the command: New-MailboxDatabase -server 'NETBIOSNAME' -Name 'DB_NAME' -EdbFilePath ':\DB_PATH\DB_NAME.edb' -LogFolderPath ':\LOG_FILE_PATH' . Where: EdbFilePath and LogFolderPath are where you want the DB and its log files. For best performance, put the DB and Logs on different drives. (Different physical disk, not partitions) Use this command to create additional databases if you like. (Archive, for example)

Mount the database with the following command: mount-database -Identity db_name

Now we must move the System Mailboxes from the default DB per this article. Execute the command Get-Mailbox -Arbitration | New-MoveRequest -TargetDatabase "db_name"

Once the move requests are completed, clear them all by executing Get-MoveRequest|Remove-MoveRequest and confirm. Note: This will clear all move requests, so if you have setup any moves other than those outlined in this article and don't want to clear them you'll need to be more granular.

Dismount the original db name with the following command: Dismount-Database 'OriginalDBName' and confirming, I.E. Dismount-Database 'Mailbox Database 1781398675'

Remove the old database with the command: Remove-MailboxDatabase 'OriginalDBName' and confirm.

You can now delete the DB folder and the log folder of the db you just deleted. The remove-mailboxdatabase command should have told you where the DB was located and by default the log folder is in the same location.

You did it, time to celebrate. Now is when you should setup your DAGs, etc. and then move user mailboxes. Let me know if there are any questions.