{"id":762,"date":"2012-05-20T15:45:04","date_gmt":"2012-05-20T15:45:04","guid":{"rendered":"https:\/\/pipe2text.com\/?page_id=762"},"modified":"2012-05-20T15:51:17","modified_gmt":"2012-05-20T15:51:17","slug":"email-an-exchange-2010-database-report-in-html-using-powershell","status":"publish","type":"page","link":"https:\/\/pipe2text.com\/?page_id=762","title":{"rendered":"Email an Exchange 2010 Database Report in HTML using PowerShell"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>After an upgrade to Exchange 2010,\u00a0I was tasked with giving Helpdesk staff an easy way to see which database they should place new users mailboxes..\u00a0There were \u00a0several databases broken down by location and multiple databases for people in those locations. Since there was no automatic provisioning system,\u00a0 the Helpdesk staff who are provisioning new users\u00a0needed a way to\u00a0easily see how many users are in a each database, the size of the database etc&#8230; to make this determination. Its also\u00a0nice\u00a0to get a snapshot view every day to make sure you don&#8217;t have an Exchange Database that&#8217;s growing out of control or to make sure your Active Databases (in a DAG scenario) are still running on the preferred server and have not\u00a0failed over. For the reasons above I put together the following script that will send an email having\u00a0four tables in HTML format. The\u00a0four\u00a0tables in the email is as include the report execution time, mailboxes per database, each database size, and the active databse server.<\/p>\n<p>To run the sript below you will need the Exchange Management Shell installed on the computer your run it from. You will need to change the &#8220;From&#8221; and &#8220;To&#8221; fields with your own email addresses. You will also need to change the SMTP server to the SMTP server used in your organization.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The Script<\/strong><\/span><\/p>\n<p>I was unable to get the script to format properly when cutting and pasting it to this page so Im poviding\u00a0as a txt file (EXDBStat.txt)\u00a0at the link below.<\/p>\n<p><a href=\"https:\/\/pipe2text.com\/wp-content\/uploads\/2012\/05\/EXDBStats.txt\">EXDBStats.txt<\/a><\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The Output\u00a0<\/strong><\/span><\/p>\n<p>The output in the email will look similar to as follows:<\/p>\n<p><a href=\"https:\/\/pipe2text.com\/wp-content\/uploads\/2012\/05\/ExDBStatsOutput.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-771\" title=\"ExDBStatsOutput\" src=\"https:\/\/pipe2text.com\/wp-content\/uploads\/2012\/05\/ExDBStatsOutput.jpg\" alt=\"\" width=\"473\" height=\"597\" srcset=\"https:\/\/pipe2text.com\/wp-content\/uploads\/2012\/05\/ExDBStatsOutput.jpg 473w, https:\/\/pipe2text.com\/wp-content\/uploads\/2012\/05\/ExDBStatsOutput-237x300.jpg 237w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><\/a><\/p>\n<p>Hope this helps. As always, I\u00a0 recommend testing this and any other scripts in a lab first. If you have any questions or feedback, please leave a comment. Thanks.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, After an upgrade to Exchange 2010,\u00a0I was tasked with giving Helpdesk staff an easy way to see which database they should place new users mailboxes..\u00a0There were \u00a0several databases broken down by location and multiple databases for people in &hellip; <a href=\"https:\/\/pipe2text.com\/?page_id=762\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"class_list":["post-762","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=762"}],"version-history":[{"count":13,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/762\/revisions"}],"predecessor-version":[{"id":778,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/762\/revisions\/778"}],"wp:attachment":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}