March 31, 2009

Quick Tip: Exchange 2007 – Using Template Databases…

Back in Exchange 2003 most of us will have used the concept of policies to apply global settings such as Limits, Maintenance Intervals and deleted item retention – and indeed I liked that feature very much as it was a good way to configure a number of settings across databases with a single click.

Of course with advent of Exchange 2007 the policy model (or at least on the surface) seems to have been removed – therefore installations which make use of many databases you seem left with the responsibility of configuring each of the above settings manually on each database.

Now you might be thinking – well that is not too bad – I only have 3 databases – but what if you have 15 or 20? – the prospect of setting storage limits on each of those manually suddenly become less attractive.

What I would like to show you in this article is how you can create a template database which can be used as a basis for a number settings that you might wish to replicate many times over (effectively creating a policy).

The great thing about a template database is that you never have to mount it – all you need to do is create it in the Exchange Management Console – modify the settings that you wish to have repeated and with the use of two lines of Powershell you are ready to roll.

Creating your Template Database

Open the Exchange Management Console and from the Server Configuration section choose “Mailbox” – from the right hand pane choose the Mailbox Server where you would like to create your Template DB you will need to ensure that there is a Storage Group ready to hold the Template database(s) in my example I have called the Storage Group “Templates” – see below:


Create a Mailbox Database within the Storage Group (it could also be a Public Folder Database) I have called my Database GEN-Template – before you click on the “New” button ensure that the “Mount this Database” option is NOT checked – see below:


When the new database has been created – from within the Exchange Management Console right click on it and from the context menu that appears choose “Properties” – see below:


You will then be presented with the Properties of your database – from here you can Edit all settings (list provided below) – customise these to suite your needs – when you are done click on the “OK” button.

The following are properties which can be “Cloned”:

General Tab:

  • Journal Recipient
  • Maintenance Schedule
  • Do not mount this database at start-up
  • This database can be overwritten by a restore

Limits Tab:

  • All of the storage Limits
  • Warning message interval
  • All Deletion settings

Client Settings:

All settings:

In my example I have changed all the values on the Limits tab – see below:


Creating a Database from the Clone

This is the clever part – for this you will need to open up an Exchange Management Shell window and type in the following commands:

$template =  Get-MailboxDatabase “<YourServerName>\Templates\General-Template”

<Press enter>

New-MailboxDatabase  -StorageGroup "Lab-ex27-01\First Storage Group" -Name "MyProductionDatabase"  -EdbFilePath T:\Clone\MyProd.edb -TemplateInstance $Template

<Press Enter>

The output from the above command should look like the following:

Name                  Server          StorageGroup         Recovery
----                  ------          ------------         --------
MyProductionDatabase  LAB-EX27-01     First Storage Group  False

If you now return to the Exchange Management Console and Refresh the Storage Group where you created your Database you will see an Entry for “MyProductionDatabase” – if you right click on and review the properties of the database you will see that your settings have been cloned – see below:


You can now mount your new production database – and use it to your hearts content.

The great thing is that you do not have to mount the Template database at all –therefore not creating the database file – you can use it as a template for as long as you wish.

This method can also be used for Storage Groups – hope that you find this useful.

Exchange 2007 Articles 0 Replies to “Quick Tip: Exchange 2007 – Using Template Databases…”