Exchange Environment Report Script V1.5 available

imageIt’s taken a while due to other commitments, but every day I’ve been beavering away on the train journey to bring you the latest and hopefully greatest version of the Exchange Environment Report – written at literally 60 miles an hour!

Since the last version, it’s had a major overhaul and hopefully you should find it faster, it now supports Exchange 2003 in 2010 and 2007 environments; and it also makes it easier to send mail and schedule the report generation.

New Features and Changes

I’ve had a quite a few requests for new features since the last version. Whilst I haven’t been able to put every feature in, there are quite a few new additions…

  • Now supports Exchange 2003 in addition to 2007 and 2010 (should support 2000 too, but not robustly tested)
  • New options to send mail with report as attachment directly from the script
  • New option to schedule itself to run nightly
  • Shows Log and Database disk free (including DBs on mount points)
  • Shows Rollup Update version as well as number
  • Major code re-factor and re-write. Down from 62KB to 33KB, only 100 lines longer even with the extra features and code should be more readable (functions at the top, main code from line 669 onwards)
  • Altered the method of data collection to avoid repetition. Most data retrieved up-front in one go then processed
  • Improved warnings and troubleshooting information on non-fatal errors (such as if it can’t get information from a server via WMI)

Fixes

There were a few bugs in the last version and the following should now be fixed:

  • Mailbox counts showed incorrectly under some circumstances. The method of calculation has changed.
  • Multiple databases with the same name in different storage groups did not show correctly.
  • More accurate mailbox and database sizes

As so much has changes since the last version, there is the chance of a few new bugs. As always let me know in the comments or at steve@goodman.net if you find any.

Download the new version from the original article here…

11 thoughts on “Exchange Environment Report Script V1.5 available

  1. hi there

    just stumbled across this script and love it….. i just wondered what you meant by
    “The 261 characters isn’t something I can fix. I’ve added the code to launch the Exchange Management shell into the script specifically to mitigate this, an hoped this would catch all but edge cases – the solution is to use a relative path in -HTMLReport or a shorter path”

    Where and how would i put a relative path?

    Many thanks

  2. Pingback: Exchange Environment Report 1.5.2 released | Steve Goodman's Exchange Blog

  3. Great work Steve..Thanks for adding Exchange 2003

    Just a few things:
    – The Exchange 2003 Mailboxes report with the Servers for each of the 4 AD sites in the Org, however in the ‘Pre-2007 Servers’ section it is only showing the 1 Exchange 2003 (This Exchange 2003 Server is in the same AD site I am running the command from, otherwise the other 3 are not)
    – This Org doesn’t have any Exchange 2007 and the following errors below appear
    – The Schedule Task doesn’t created – ERROR: Value for ‘/TR’ option cannot be more than 261 character(s).
    – Is it possible to add a %DATETIME% parameter to the code, so when scheduling the report to run each day it won’t over write the last copy of report.html each time

    [PS] D:\Exchange2010\Scripts>.\Get-ExchangeEnvironmentReport -HTMLReport D:\Exchange2010\Reports\report.html -SendMail:$true -MailFrom:ExchangeReports@test.local -MailTo:first.last@test.local -MailServer:smtp.test.local -ScheduleAs:test.local\admin.adm
    WARNING: Active Directory server settings remained unchanged.
    Exception calling “Add” with “2” argument(s): “Item has already been added. Key in dictionary: ‘Pre 2007 Servers’ Key
    being added: ‘Pre 2007 Servers'”
    At D:\Exchange2010\Scripts\Get-ExchangeEnvironmentReport.ps1:806 char:35
    + $ExchangeEnvironment.Pre2007.Add <<<< ("Pre 2007 Servers",$ExSvr)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary: 'Pre 2007 Servers' Key
    being added: 'Pre 2007 Servers'"
    At D:\Exchange2010\Scripts\Get-ExchangeEnvironmentReport.ps1:806 char:35
    + $ExchangeEnvironment.Pre2007.Add <<<< ("Pre 2007 Servers",$ExSvr)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary: 'Pre 2007 Servers' Key
    being added: 'Pre 2007 Servers'"
    At D:\Exchange2010\Scripts\Get-ExchangeEnvironmentReport.ps1:806 char:35
    + $ExchangeEnvironment.Pre2007.Add <<<< ("Pre 2007 Servers",$ExSvr)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Attempting to schedule task as test.local\admin.adm…
    Task to schedule: powershell -executionpolicy unrestricted \"pushd D:\Exchange2010\Scripts; D:\Exchange2010\Scripts\Get
    -ExchangeEnvironmentReport.ps1 -HTMLReport D:\Exchange2010\Reports\report.html -SendMail:$true -MailFrom:ExchangeReport
    s@test.local -MailTo:first.last@test.local -MailServer:smtp.test.local\"
    ERROR: Value for '/TR' option cannot be more than 261 character(s).

    • Hi David,

      The first two I think are related.. I think I have missed something obvious – I’ll take a look in the morning and expand my Exchange 2003 test environment to catch this.

      The 261 characters isn’t something I can fix. I’ve added the code to launch the Exchange Management shell into the script specifically to mitigate this, an hoped this would catch all but edge cases – the solution is to use a relative path in -HTMLReport or a shorter path.

      Date/Time is a really good idea – maybe if there was a -PrefixDate option this would do the job.

      Keeping a record is something I am planning – what I want to do is two-fold. Firstly, succinctly list changes since the last run, and secondly (from a request) keep track of database usage historically and use that data to trend from – maybe a small graph or “predict full” date. If you’re keeping these reports then I would be interested to know what would be useful so I can bear it in mind.

      Steve

  4. For the v1.5 script,

    MSGMBX01 MBX01SG02 MBX01MS02 117 110,60 MB 25,86 GB -0,90 GB 68,0% 90,8% 21.07.2011 18:04:56

    Look at the db whitespace part, it is -0,90 GB

  5. Pingback: Generate Exchange Environment Reports using Powershell

Comments are closed.