14
Readme file for the new Email Organization Report, a PowerShell Script to collect and report Exchange Environments. The script uses some external functions from other authors. Copy rights are included inside the script code. 2014 Ammar Hasayen @ammarhasayen.com Email Organization Report Version 2.4 4/24/2014 Get-CorpEmailReport v2.4.8

Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

  • Upload
    vannga

  • View
    217

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Readme file for the new Email Organization Report, a PowerShell

Script to collect and report Exchange Environments.

The script uses some external functions from other authors.

Copy rights are included inside the script code. Ammar Hasayen @ammarhasayen.com

Email Organization Report Version 2.4

4/24/2014

2014Get-CorpEmailReport v2.4.8

Page 2: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Script Name: Get-CorpEmailReport.PS1 Script Version: 2.4.8 Author: Ammar Hasayen Description: Generate Exchange Organization Email Report Twitter: @ammarhasayen Email: [email protected] Paper Version: 2.0

Get-CorpEmailReport.ps1 is an Email Organization Report and a great tool for IT Professionals who are working with Microsoft Exchange systems.

This report will get organization wide information about your Email infrastructure, from Exchange servers O.S info, service health, up time details, beside Exchange and database highly aggregated information.

Not only will you get a nice Dashboard describing your Exchange, you will get aggregated information about how much resources your email infrastructure is consuming in terms of server count, mailboxes and total storage.

What you will get when running the script, is an overall overview about:

1. Exchange Servers in your organization[Break down by AD Site][Info about External and Internal Web services names][Mailbox Count per AD Site]

O.S version O.S Service Pack level. Exchange Service health. Up time in days. Exchange Version. Exchange Service Level. Exchange Rollup Update Information. Exchange Role(s). Number of mailboxes in case of MBX role.

2. Database Full Inventory[Break down by DAG][Separate Table for Recovery DBs][Separate Table for Non DAG DBs][Table per DAG]

DB Name. Server Location. Mailbox Count.

Get-CorpEmailReport

Page 3: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Average Mailbox Size. Archive Mailbox Count. Average Archive Mailbox Size. Mount Status. DB Size. Storage Group Name (Pre E2010). White Space. Circular Logging. DB Disk Free Percentage. Log Disk Free Percentage. Last Full Backup Date. Backed up Since (Days) – with customized thresholds. Quota Info: Prohibit Send. Quota Info: Prohibit Send and Receive. DB Activation Preference Check [Is it mounted on the preferred Server?]. DB Copy Location and Activation Preference assignment.

3. Mailbox Type Aggregated Data: User Mailbox Count. Shared Mailbox Count. Room Mailbox Count. Discovery Mailbox Count. Equipment Mailbox Count.

4. Exchange Server Aggregated Data Total Number of Exchange Servers break down by

i. Version.ii. Role.

5. Mailbox Aggregated Data[Overall Statistics for the Organization]

Total Mailbox Count. Total Mailbox Size. Average Mailbox Size. Total Archive Count. Total Archive Size. Average Archive Size.

6. Database Activation Preference Map Table[Table per DAG]

List of all DAG DBs Information about Database Copies for each DB. Information about Activation Preference for each Copy (MBX info). Total number of DB Mounted per DAG Server.

Get-CorpEmailReport

Page 4: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Total number of DB Copies per DAG Server. Ideal number of DBs mounted per server using Activation Preference.

7. Charts and Diagrams Chart: DB Vs Mailbox Count. Chart: DB Vs Size in GB. Chart: DB Vs Backed Up Since (Days). Chart: Server Vs DB Count. Chart: Server Vs Mailbox Count.

8. Script Filter Finally!![This has been for a long time a pending and requested feature]

Filer by comma separated Exchange Servers.[Example: “Srv1, Srv2, Srv3...”]

Filter by Expression.[Example: “*LON”][This will get all Exchange Servers with names ending with “LON”[Example: “UK*”][This will get all Exchange Servers with names started with “uk”

Filter by list of DAG names[Example: “Dag1, Dag2,”[This will get all Exchange Servers member of those DAGs and will narrow the script scope to those DAGs only.

9. Script Log Files[Used for logging script actions and steps taken]

Information Log File.[Records script progress, actions, and gives you insights about what data being collected]

Detail Log File.[Record detailed information for every single information detected for Exchange servers and databases. This can be used as inventory info]

Error Log File[Records any termination errors along with all information about the error internal exception messages and commands failing with line number info]

10. Totally new output screen when running the script interactively: New Time Watch to record the script execution time. Nested on screen progress bar to give you an idea about how long the script will run. On screen step by step statistics, so you can get quicker info while the script is running. Verbose Mode for advance detailed information on the screen. At the end of the script, couple of information will be displayed to list you the log files

created with their location, and aggregate information and statistics about your Exchange Environment.

Get-CorpEmailReport

Page 5: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Send Email option.

11. PowerShell Remoting to get WMI Data [Totally New][New switch in the script to enable the use of PowerShell Remoting instead of RPC legacy calls. You can use this switch if you have enabled your Exchange servers for PS Remoting. The huge benefit for doing this, is simply security and reliability. The script in this mode will try to test WS-MAN connectivity and its version for each remote computer and then decide how to get WMI data. If for any reason PS remoting is not available on a remote computer, the script will fall back to legacy normal RPC calls to ensure reliability of getting the WMI data].

12. Totally New Chart PowerShell Wrapper[The script is armed with totally new reliable Chart engine “code name: Get-CorpChart_Light” that will do smart calculation to change the chart dimensions and size depending on the number of input data. You will no longer get so crowded charts filled with letters that you cannot read. The chart engine will use a smart algorithm to calculate the best dimensions of the graph depending on the number of input data].

13. Better Error and Exception Handling [Finally][The script uses complicated logic to track exception and errors, classifying them to categories, logging them to different log files using an internal function called “Write-CorpError”. After that, in most cases, the error will be logged, execution will continue without bothering you with on screen bad error messages. If the error affects the execution of the script, a nice and informative message will be displayed on the screen and log files with suggestions if possible to how to solve it].

14. Works with all Exchange versions.[This was a limitation on the previous script that only worked with Exchange 2010. This version solves this limitation by supporting all versions of Exchange]

15. Smart Dashboard HTML Table with customized thresholds. [You can configure couple of thresholds for DB Backup days and Server up time data, like how many days since the server restarted. When the threshold is crossed, the dashboard output HTML will color the affected cells, grapping your attention to what matters quickly.].

16. Script divided into Modules with lots of regions[To better understand the code, the script is divided into the below modules to better organize and browse through the script code.

- Module 1 : Customization[Thresholds for you to customize]

- Module 2 : Functions[Script functions]

- Module 3 : Factory[Preparation tasks like creating log files and variable initialization]

Get-CorpEmailReport

Page 6: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

- Module 4 : Process[Getting the data]

- Module 5 : Output[Outputting the data]

- Module 6 : Charts[Drawing the data]

- Module 7 : Final Tasks[Sending email and closing log files]

17. Joined effort in writing the code. [Some of the script internal functionalities, specifically getting structured data part, is written by Steve Goodman, a Microsoft MVP at the time of writing this script. After communicating with Steve, who is a wonderful professional, his internal functions that gets structured internal data, are used as a base for writing the Process Module of the script. Big thanks to Steve on helping writing this module. I also used couple of helper functions from the online community like the Log Functions. Copyrights are mentions in the code.]

Get-CorpEmailReport

Page 7: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Script ChartsWhat makes this script unique and outstanding, is the chart module. Nothing more exciting than parsing the output data in sorted nice looking charts.

Four charts will be generated after running the script. Each chart is designed carefully to get the information that matters most to IT Professional.

Chart Module is using a smart algorithm that will get information from your Exchange organization, digest it, and then decide what is the best way to output the chart depending on the number of data items. In this way, you will not get small crowded charts with hard to read data, instead, the graph dimensions will be scaled dynamically according to the number of items to draw.

Get-CorpEmailReport

Page 8: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Get-CorpEmailReport

Page 9: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

DB Activation Preference Table [New]Have you used the product team Exchange calculator where you input your data and a nice formatted table get generated for all your databases, and their copy status along with the activation preference?

The script is intelligent enough to collect your DAG information, database copy locations, their activation preference, and then generate a similar live dashboard with a colored cell indicating a red alarm if a database is mounted on a non-preferred mailbox server.

Get-CorpEmailReport

Page 10: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Aggregated Data

The script will also present a nicely formatted tables with aggregated information like the mailboxes per type, Exchange servers per role and version, and also mailbox and archives count, sizes and average size.

Get-CorpEmailReport

Page 11: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Detailed information for Servers and Databases

Of course the script will not be perfect if a detailed information is not presented. The script will start creating HTML tables for all your Exchange servers with all detailed information, including version, OS Info, Rollup Updates version, Service health, Up Time information and more.

Get-CorpEmailReport

Page 12: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Also, for each database, you will get a detailed information about the database and all its properties with smart thresholds that you can customize.

Copy RightsThe script is based on Steve Goodman, a Microsoft MVP at the time of writing this document. Steve Script: “Generate Exchange Environment Reports using PowerShell” Version 1.5.8, 2nd Feb 2014, is used heavily as a foundation to build this script.

Steve worked hardly in writing an outstanding script to collect information from all versions of Exchange servers, and get a nicely formatted output. This script extends Steve’s script functionalities by adding a lot of functionalities like: new on screen progress, charts, HTML DB Activation output, PowerShell

Get-CorpEmailReport

Page 13: Email Organization Report v2.4.8 Description - Ammar Web viewScript to collect and report Exchange Environments. ... Factory [Preparation tasks ... I encourage you to visit his blog

Remoting module, Log files tracking, more aggregated data, new table for Mailbox type, new table for Recovery Databases, threshold options, two new Filter functionalities (by DAG names, and by Server names), new module for error handling and logging, more data collected for Exchange and Databases.

A separate communication with Steve has been done to ensure copy rights before releasing this extended script. I encourage you to visit his blog and browse his script: http://www.stevieg.org/2011/06/exchange-environment-report/

Get-CorpEmailReport