Doug's Think-Tank

An Eruption of Pondering...

Exchange Daily Messaging Report

Exchange Daily Messaging Report

  • Comments 1
  • Likes

I was tasked with creating a daily messaging report that would meet the following requirements:

  • Collect essential information about the Exchange 2007 environment
  • Save the data in HTML format
  • Email that report to users

So I created a powershell script that would collect the following information:

  • Mailbox Stats (total #, over quota, over 5GB, etc)
  • Message Stats (number of msg sent/rcd, NDRs, total size, etc)
  • Identify servers who have volumes with less than 20% of free space available
  • Database Information (last full backup, is mounted?, # of mbx, size, etc)
  • Identify if any SMTP queues have more than 50 msgs pending delivery
  • Collect errors from event log, generated during past 24 hours

Once collected, it will send a message with the information as an attached and within the body of the message.


Thanks to http://blogs.technet.com/b/gary/ & http://gsexdev.blogspot.com/ for their contribution

Attached is the script (right click and save target as for proper formatting)

Have fun!

Doug

Attachment: DailyReport.ps1.txt
Comments
  • Great script! Thanks.

    I am getting these errors on the free disk space calculation (I have 4 servers in the servers.txt file):

    Bad numeric constant: 2,605.26.

    At C:\psscripts\DailyReport.ps1:132 char:40

    +            $Pfree = "{0:P2}" -f ($free/ <<<< $size)

       + CategoryInfo          : InvalidOperation: (2,605.26:String) [], RuntimeException

       + FullyQualifiedErrorId : BadNumericConstant

    Bad numeric constant: 2,536.23.

    At C:\psscripts\DailyReport.ps1:132 char:40

    +            $Pfree = "{0:P2}" -f ($free/ <<<< $size)

       + CategoryInfo          : InvalidOperation: (2,536.23:String) [], RuntimeException

       + FullyQualifiedErrorId : BadNumericConstant

    Bad numeric constant: 2,664.45.

    At C:\psscripts\DailyReport.ps1:132 char:40

    +            $Pfree = "{0:P2}" -f ($free/ <<<< $size)

       + CategoryInfo          : InvalidOperation: (2,664.45:String) [], RuntimeException

       + FullyQualifiedErrorId : BadNumericConstant

    Bad numeric constant: 2,936.77.

    At C:\psscripts\DailyReport.ps1:132 char:40

    +            $Pfree = "{0:P2}" -f ($free/ <<<< $size)

       + CategoryInfo          : InvalidOperation: (2,936.77:String) [], RuntimeException

       + FullyQualifiedErrorId : BadNumericConstant

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment