Git Product home page Git Product logo

get-exchangeorganizationreport's Introduction

Get-ExchangeOrganizationReport.ps1

GitHub

license license

This script fetches Exchange organization configuration data and exports it as Word document.

NOTE

The script is currently under development in version 0.9.

You are welcome to contribute to the PowerShell script development.

Description

This script reads Exchange Organization data and creates a single Microsoft Word document. A later version will support exporting to an Html file.

The script requires an Exchange Management Shell for Exchange Server 2016 or newer. Older EMS versions are not tested.

A locally installed version of Word is required, as plain Html export is not available.

The default file name is 'Exchange-Org-Report [TIMESTAMP].docx'

Most of the script requires only Exchange admin read-only access for the Exchange organization. Querying address list information requires a membership in the RBAC role "Address Lists".

The script queries hardware information from the Exchange server systems and requires local administrator access to the computer systems.

Requirements

  • Windows Server 2016+, Windows 10
  • Exchange Server Management Shell
  • Word 2016+
  • Required Exchange Role Assignment: Address Lists
  • PowerShell Script saved with UTF-8 encoding as it contains certain UTF-8 characters

Revision History

  • v0.9 Initial community pre-release
  • v0.91 Information about processor cores, memory, and page file size added

Parameters

CompanyName

The company name to use on the cover page.

ExportTo

Target output format for the report.

Valid values: MSWord, Html Default: MSWord

Html is currently not implemented

CoverPage

The cover page name for use by Microsoft Word. Only Word 2010 or newer are supported. The available cover pages depend on the type of Word setup and locale installed on the system.

The default cover page is Sideline.

CompanyAddress

Company address to use on the cover page, if the cover page contains an Address field.

CompanyEMail

Company email address to use on the cover page, if the cover page contains an Email field.

CompanyFax

Company fax number to use on the cover page, if the cover page contains a Fax field.

CompanyPhone

Company phone number to use on the cover page, if the cover page contains a Phone field.

ViewEntireForest

ViewEntireForest switch to set the scope for all Exchange cmdlets to view the entire Exchange Org

ADForest

Specifies the Active Directory forest object by providing the forest name.

Currently not implemented. Reserved for future use.

ADDomain

Specifies the Active Directory domain object by providing the doamin name.

Currently not implemented. Reserved for future use.

IncludedDetails

Switch to include object detail information in the genereted report. Including detailed object information might add a large number of additional pages to the report.

Detailed information is included for the following objects:

  • User Role Assignments
  • Outlook Web App Policies
  • Retention Policy Tags
  • Mobile Device Policies
  • Address Lists
  • Malware Policies
  • Transport Rules
  • Email Address Policies
  • Receive Connectors
  • Send Connectors
  • Database Availability Groups

IncludePublicFolders

Switch to include detailed reporting on modern public folder hierarchy.

Using this switch results in an extended run of this scripts depending on the size of public folder hierarchy.

Partially implemented.

IncludeIntroduction

Switch to include an introductory text at the beginning of the report.

SendMail

Switch to automatically send the generated report by email.

Currently not implemented.

MailFrom

Email address of the report sender.

MailTo

Email address of the report recipient.

MailServer

Fully qualified domain name (FQDN) of the mail server for sending the report email.

Examples

.\Get-ExchangeOrganizationReport.ps1 -ViewEntireForest:$true

Creates a Word report for the local Exchange Organization using the default values defined on the parameters section of the PowerShell script.

.\Get-ExchangeOrganizationReport.ps1 -Verbose

Creates a Microsoft Word report for the local Exchange Organization with a verbose output to the current PowerShell session.

Note

THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.

Credits

Written by: Thomas Stensitzki

Stay connected

twitter linked blog mvpblog

Follow my Tech Talk video channel or podcast

spotify youtube techtalk

Additional Credits

get-exchangeorganizationreport's People

Contributors

apoc70 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

get-exchangeorganizationreport's Issues

Add log file paths

Add log file folder paths for Exchange and IIS to document (each server)

Script returns some errors

Hi,

the script is returning some errors, not sure about the root cause:

[PS] C:\Temp>.\Get-ExchangeOrganizationReport.ps1 -Verbose
VERBOSE: 6/28/2022 3:51:57 PM: Script started.
VERBOSE: 6/28/2022 3:51:57 PM: Company name is ACME Inc.
VERBOSE: 6/28/2022 3:51:57 PM: Creating Word ComObject
VERBOSE: 6/28/2022 3:51:59 PM: Word language value is 1033
VERBOSE: 6/28/2022 3:51:59 PM: Validating cover page Sideline for culture code en-
VERBOSE: 6/28/2022 3:51:59 PM: Loading Word templates
VERBOSE: 6/28/2022 3:52:01 PM: Starting fetching data from Active Directory and Exchange Org - Please be patient
Add-WordTable : Cannot validate argument on parameter 'Hashtable'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again.
At C:\Temp\Get-ExchangeOrganizationReport.ps1:3098 char:39

  • $Table = Add-WordTable -Hashtable $HashTable `                                                                                                       
    
  •                                   ~~~~~~~~~~                                                                                                             + CategoryInfo          : InvalidData: (:) [Add-WordTable], ParameterBindingValidationException                                                            
    
  • FullyQualifiedErrorId : ParameterArgumentValidationError,Add-WordTable You cannot call a method on a null-valued expression.
    At C:\Temp\Get-ExchangeOrganizationReport.ps1:3103 char:5
  • Set-WordCellFormat -Collection $Table.Rows.Item(1).Cells -Bold -B ...                                                                                +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                       + FullyQualifiedErrorId : InvokeMethodOnNull                                                                                                                                                                                                                                                                      You cannot call a method on a null-valued expression.                                                                                                      At C:\Temp\Get-ExchangeOrganizationReport.ps1:3105 char:5                                                                                                  +     $Table.Columns.Item(1).Width = 140                                                                                                                   +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                       + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                       + FullyQualifiedErrorId : InvokeMethodOnNull                                                                                                                                                                                                                                                                      You cannot call a method on a null-valued expression.                                                                                                      At C:\Temp\Get-ExchangeOrganizationReport.ps1:3106 char:5                                                                                                  +     $Table.Columns.Item(2).Width = 50                                                                                                                    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                       + FullyQualifiedErrorId : InvokeMethodOnNull                                                                                                                                                                                                                                                                      You cannot call a method on a null-valued expression.                                                                                                      At C:\Temp\Get-ExchangeOrganizationReport.ps1:3107 char:5                                                                                                  +     $Table.Columns.Item(3).Width = 50                                                                                                                    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                       + FullyQualifiedErrorId : InvokeMethodOnNull                                                                                                                                                                                                                                                                      You cannot call a method on a null-valued expression.                                                                                                      At C:\Temp\Get-ExchangeOrganizationReport.ps1:3108 char:5                                                                                                  +     $Table.Columns.Item(4).Width = 50                                                                                                                    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                       + FullyQualifiedErrorId : InvokeMethodOnNull                                                                                                                                                                                                                                                                      You cannot call a method on a null-valued expression.                                                                                                      At C:\Temp\Get-ExchangeOrganizationReport.ps1:3109 char:5                                                                                                  +     $Table.Columns.Item(5).Width = 140                                                                                                                   +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                       + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                       + FullyQualifiedErrorId : InvokeMethodOnNull                                                                                                                                                                                                                                                                      You cannot call a method on a null-valued expression.                                                                                                      At C:\Temp\Get-ExchangeOrganizationReport.ps1:3112 char:5                                                                                                  +     $Table.Rows.SetLeftIndent($Indent0TabStops,$wdAdjustNone)                                                                                            +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                       + FullyQualifiedErrorId : InvokeMethodOnNull                                                                                                                                                                                                                                                                      Add-WordTable : Cannot validate argument on parameter 'Hashtable'. The argument is null, empty, or an element of the argument collection contains a null   value. Supply a collection that does not contain any null values and then try the command again.                                                           
    

At C:\Temp\Get-ExchangeOrganizationReport.ps1:3584 char:39 + $Table = Add-WordTable -Hashtable $HashTable + ~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Add-WordTable], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Add-WordTable You cannot call a method on a null-valued expression. At C:\Temp\Get-ExchangeOrganizationReport.ps1:3589 char:5 + Set-WordCellFormat -Collection $Table.Rows.Item(1).Cells -Bold -B ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Temp\Get-ExchangeOrganizationReport.ps1:3591 char:5 + $Table.Columns.Item(1).Width = 100 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Temp\Get-ExchangeOrganizationReport.ps1:3592 char:5 + $Table.Columns.Item(2).Width = 80 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Temp\Get-ExchangeOrganizationReport.ps1:3593 char:5 + $Table.Columns.Item(3).Width = 80 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Temp\Get-ExchangeOrganizationReport.ps1:3594 char:5 + $Table.Columns.Item(4).Width = 100 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Temp\Get-ExchangeOrganizationReport.ps1:3596 char:5 + $Table.Rows.SetLeftIndent($Indent0TabStops,$wdAdjustNone) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull VERBOSE: Server ASEXCHYBRID01 | PageFileSize 20490 MB VERBOSE: Server ASEXCHYBRID01 | Cores 4 Add-WordTable : Cannot validate argument on parameter 'Hashtable'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again. At C:\Temp\Get-ExchangeOrganizationReport.ps1:4142 char:39 + $Table = Add-WordTable -Hashtable $HashTable + ~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Add-WordTable], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Add-WordTable You cannot call a method on a null-valued expression. At C:\Temp\Get-ExchangeOrganizationReport.ps1:4147 char:5 + Set-WordCellFormat -Collection $Table.Rows.Item(1).Cells -Bold -B ...

  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Temp\Get-ExchangeOrganizationReport.ps1:4149 char:5

  • $Table.Columns.Item(1).Width = 100
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Temp\Get-ExchangeOrganizationReport.ps1:4150 char:5

  • $Table.Columns.Item(2).Width = 150
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Temp\Get-ExchangeOrganizationReport.ps1:4152 char:5

  • $Table.Rows.SetLeftIndent($Indent0TabStops,$wdAdjustNone)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

VERBOSE: 6/28/2022 3:53:24 PM: Updating the Table of Contents (ToC)
VERBOSE: 6/28/2022 3:53:25 PM: Saving Word file as: C:\Temp\Exchange-Org-Report-2022-06-28.docx
VERBOSE: 6/28/2022 3:53:27 PM: Script finished.
The script runtime was 1min 29s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.