For quite a while I’ve had automated PowerShell scripts that monitor our Exchange database sizes. I set this up so we could see weekly/monthly/annual growth patterns for different departments in the company. We weren’t really concerned about running out of space on the backend servers, but it would be good to have a rouch idea of the trajectory. And more data is always better, right?

To start, here is how you get the database size in Exchange PowerShell:

That size format is a bit odd, but in Exchange 2010, PowerShell would let me convert that to gigabytes, using the ToGB() function on the DatabaseSize property. So, I set up a script to iterate through all of our databases, convert each DatabaseSize to GB, and then enter that data into a database.

I don’t know the exact reason, or I at least can’t find any documentation indicating that Microsoft changed anything. However, in my search for a solution, I found this forum post, which gave me the fix. I inserted these two lines at the top to load the Exchange Data dll:

This is how I got my data out of Exchange. I also set up a task in Task Schedular to run this every night. Over time this generates a nice bit of data that can be charted. Once I have a bunch of data, maybe I will come back and edit this post with some of those visulations.