I often find that I need to list Exchange databases on a particular server by database size. Exchange 2007 doesn’t provide a mechanism to get this data directly from the management console or shell, but it’s reasonably easy to use the Exchange Management Shell to run a command which will give the answer.
The first thing to do is get a list of databases which we are interested in – it could be a list of databases on a particular server or databases which match a particular name pattern.
I recently had a problem where a particular Outlook 2007 plug-in was causing sent e-mail messages to become “stuck” in the Outlook Outbox folder. The messages had actually been sent, and the “stuck” messages were only visible in Outlook Web Access or non-cached mode. So that we could remove the messages I needed to find out how many users where affected and how many messages those users had in their Outbox folders.
Fortunately the Exchange Management Shell provides cmdlets for answering these questions, and it can all be done with a PowerShell one-liner. While I was interested in counting messages specifically in the Outbox folder, the same technique could be used to count messages in any mailbox folder.
One of the questions I get on a regular basis is how to move the database file and the log files to a different location.
First of all, it is a best practice to change the database and log files location. By default they are configured to use c:\program files\microsoft\exchange server\mailbox\first storage group (in Exchange Server 2007). Change this to a separate physical disk, and if possible two separate physical disks, one for the database file and one for the log files. If one of these two disks fails you have a much better recovery scenario then when the database and the log files are located on one physical disk. Also from a performance point of view it’s better to use two separate physical disks.