Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site

   

Subscribe to OutlookExchange
Anderson Patricio
Ann Mc Donough
Bob Spurzem
Brian Veal
Catherine Creary
Cherry Beado
Colin Janssen
Collins Timothy Mutesaria
Drew Nicholson
Fred Volking
Glen Scales
Goran Husman
Guy Thomas
Henrik Walther
Jason Sherry
Jayme Bowers
John Young
Joyce Tang
Justin Braun
Konstantin Zheludev
Kristina Waters
Kuang Zhang
Mahmoud Magdy
Martin Tuip
Michael Dong
Michele Deo
Mitch Tulloch
Nicolas Blank
Pavel Nagaev
Ragnar Harper
Ricardo Silva
Richard Wakeman
Russ Iuliano
Santhosh Hanumanthappa
Steve Bryant
Steve Craig
Todd Walker
Tracey J. Rosenblath
 
 

Displaying the Report                Download Scripts

All the data that is captured by the mailbox size report script is saved into one table in a access database, because the date is also saved with each record this field can be used to create different views of the data. For this article I've used an Access database so to create the views of data I've used different queries to group data for comparison. There are two queries for each time period that is going to be displayed this was done to support the drilldown function of the report (Access's joins aren't as flexible as MsSQL server so this was the reason for two separate queries). The queries themselves are quite basic they return a result set based on a defined date function and a SQL parameter to only show the total size of the mailbox where applicable. To create the report itself two more queries have been created which display results based on the other database queries I've just talked about. This is achieved by using joins of the date queries and also using some SQL math functions to determine the usage for each mailbox . The second mailbox report query is used for the drill down asp page and is designed to be used with a input parameter.

Report Pages

To display the mailbox size data in a easily accessible format I've create 2 ASP pages that query the access database. The pages in the download for this article are designed to run locally on the exchange server where the mailbox size report was run against and where the access database is located. This can be modified however all you need to do is change the ADO section of the ASP file. The pages themselves are very simple they perform a query of the access database and display the results to the user. The first page shows total sizes of all mailboxes and usage statistics and provides a link to allow you to drill into a mailbox to get the size of each folder in a mailbox and also to access the graph page. Page1 looks like this and Page 2 looks like this.

Graph Page

The graph page is an optional part of the report, it can come in use to allow you to see the growth pattern across a month it looks like this. To generate the graph itself I've used a 3rd party Java applet which you can download for free from here. The page itself is another asp page that uses ADO to retrieve data from a Access query that filters the last 30 days of Total size results.

Installing and using the Report pages

As with the scripts in this article there is one hard coded reference in the ASP pages you need to be aware of before you use them which is the ADO reference to the database being located on the root of the d: drive

dataConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\mbsize.mdb"

After this to install them you can create a directory under the default website call it something like mailboxreport put the 3 asp pages in that directory and you should be ready to go. If you are using Windows 2003 you need to make sure you have enabled ASP pages under the IIS web service extensions.

Installing and using the Graph page

As with the report scripts there is one hard coded reference in the ASP pages you need to be aware of before you use them the ADO reference to the database being located on the root of the d: drive

The other thing that's necessary to use the graph page is you must download the java chart applet from here .I have no association with the people that wrote this Java applet they currently provide a free download of a branded applet so please respect the usage rights of the author. The code I've written simply provides a method of using this applet with the mailbox reports. Once you have downloaded the applet you will have one java class file called linegraph.class all you need to do is place this in the same direction as the 3 asp files and it should work okay. To use the graphs all you need then is a browser with at least the Microsoft Java virtual machine installed and enabled.

Download Scripts


Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Stephen Bryant or Pro Exchange. OutlookExchange.Com, Stephen Bryant and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

Copyright Stephen Bryant 2008