Generate Exchange Environment Reports using Powershell

image

Update 16th September – V1.6.1 – Exchange 2016 support and various bug fixes (see here for more information)

Update 2nd February – V1.5.8 – Exchange 2013 CU and SP support, HTTPS and CAS array names shown, initial Office 365 Hybrid support (see here for more information)

Update 19th January – V1.5.6 – Exchange 2013 support and bug fixes (see here for more information)

Update 17th August – V1.5.4 – New features and bug fixes (see here for more information)

Update 24th July – V1.5.3 – Bug fixes (see here for more information)

Update 21th July – V1.5 – Re-write with new features including Exchange 2003 support for mixed environments and more detailed information (see here for more information)

Update 21th June – V1.1 – Bug fixes, Exchange 2007-only support in addition to 2010/2010+2007, and new features.

As an Exchange administrator, there’s times when it’s useful to have a visual, straightforward and concise document that gives you a good overview of your environment. Although with tools like Visio and Word you can make such a document, it’s hard to keep these documents up to date or use previous versions to track and check changes.

This script, inspired by the output of an Exchange TAP tool, aims to automatically generate a report that gives you an overview of your environment, Exchange 2003, 2007, 2010, 2013 and 2016 servers and database availability groups – in particular:

    • Total Servers per Exchange version & service pack
    • Total Mailboxes per Exchange version & service pack, plus Office 365 remote mailboxes
    • Totals for Exchange roles across the environment
    • A site-by-site breakdown for the following:
      • Mailboxes per site
      • HTTPS FQDNs used for Internal, External and SCP URLs
      • CAS array names
      • Exchange servers, version, update rollup and version, service level, highlighted installed roles, OS version and service pack

 

    • A breakdown of each Database Availability Group including:
        • DAG name, member count and member list
        • Database information such as
          • Name
          • Mailboxes per database and Average Size
          • Archive mailboxes per database and Average Size only shown if a DB includes Archive mailboxes
          • Database and whitespace size
          • Database and log disk free space percentage
          • Last full backup date/time (new) – only shown if at least one DAG DB has had a full backup
          • Circular Logging state (new) only shown if at least one DAG DB has circular logging enabled
          • Server hosting the active copy
          • List of servers hosting copies and copy count
    • A breakdown of Non-DAG databases including Exchange 2007 and 2003 DBs, including the database information above, along with Storage Group name (where applicable).

The script doesn’t support detailed information about Exchange 2007/2003 CCR/SCC clusters, but these are shown as ClusMBX in the output. At the moment, the script doesn’t show Public Folder information but if there is interest I can add extra features; and of course the source is provided should you wish to alter it to your own needs.

To be able to execute the script, you need to use the Exchange Management Shell (the latest version for your environment, with Powershell 2.0) and be able to get information about AD Sites, Exchange Servers, Mailboxes, Database Availability Groups and Databases. It uses WMI to retrieve OS information and detect Exchange 2007 clusters and calculate Exchange 2007 database size and Remote Registy calls to get Update Rollup information. A normal Exchange administrator should be able to perform these tasks.

Executing the script is straightforward – the only setting you need is to specify where to write the HTML file:

1
.\Get-ExchangeEnvironmentReport -HTMLReport c:\report.html

If you want it to email the results, the follow parameters are available to allow the report to be sent directly from the script:

1
.\Get-ExchangeEnvironmentReport -HTMLReport c:\report.html -SendMail:$true -MailFrom:you@example.com -MailTo:you@example.com -MailServer:smtp.example.com

As usual, the script is provided to download as-is without any warranties, at the bottom of this post. Comments and suggestions are always welcome.

Download Get-ExchangeEnvironmentReport.ps1

 

 

663 thoughts on “Generate Exchange Environment Reports using Powershell

  1. hello stev

    my name is nir and i am system admin on a company in the Communications

    industry in israel.

    i am fascinated from your blog and now i am trying to use your

    “Generate Exchange Environment Reports using Powershell”.

    my environment is 2 exchange 2010 in a dag that run over servers 2008r2 sp1.

    i can run the script without errors but in the html report there are many details that missing like :

    Database Name
    Mailboxes Av. Mailbox Size Archive MBs Av. Archive Size DB Size/WhiteSpace Last Full Backup Circular Logging
    Active Owner Copies (n)
    what can go wrong ?

  2. hellp !!

    graete script !!

    i run it in my production environment … Exchange 2010 SP3 UR11 ..win srv 2008 r2 ent.

    its all good but many information don’t appears in the report.

    details like :Database Name ,MailboxesAv., Mailbox Size, Archive MBsAv. Archive Size, DB Size/WhiteSpace, Last Full Backup, Circular Logging,Active Owner Copies (n)

    any help ??

  3. Hi Everybody,

    When we ran Exchange Environment Report, It was completed the following error.

    Exchange 2010 DAG.

    “You must provide a value for this property.
    (0:Int32) [Get-MailboxDatabase]
    FullyQualifiedErrorId: 179A7E5B,Microsoft,Exchange,management,SystemConfigurationTasks.GetMailboxDatabase”

    Thanks in advanced.

  4. Hi everbody,

    We have DAG (Eight Mbox Server) (both servers with each other)

    When we ran Exchange Environment Report, It was completed the following error.

    And report had created missing..

    ==============================================
    You must provide a value for this property.
    + CategoryInfo : NotSpecified: (0:Int32) [Get-MailboxDatabase], DataValidationException
    + FullyQualifiedErrorId : 16C18E48,Microsoft.Exchange.Management.SystemConfigurationTasks.GetMailboxDatabase
    ======================================

    Thank in advance.

  5. Hi Steve,

    Thanks for this awesome script. I have been using it in many environments. In one of the environments that we use the script we have been asked if we can report on a specific site only.

    Please advise if this would be possible?

  6. Hello, i noticed the Database Disk Free %’s isn’t accurate. I have Exchange 2013 with both DB and Logs in a single 900GB LUN. Example i have: is a DB with only 45 mailboxes amounting to 72GB (including Logs) and the % is claiming 79 when it should only be 92.

    Let me know if i’m simply misunderstanding what the value is expected to be. 🙂

    Sample:

    Mailboxes Av. Mailbox Size DB Size DB Whitespace Database Disk Free Log Disk Free
    45 1,283.70 MB 66.13 GB 0.04 GB 79.5% 79.5%

  7. Hi Steve,

    I am trying to run this report on Exchange 2013 CU9 (4x node DAG) and unable to retrieve any information about databases. It provides report about servers but all information related to DAG is missing/ empty (servers, database name, mailboxes and etc.).

  8. Hey Steve – While running this on a single Exchange 2010 server with just one database, it doesn’t return any info about the database at all. I ran it on an Exchange 2010 SP2 UR5 v2. Any advice?Thanks.

  9. On a single box with exchange 2013 getting this error when running from exchange shell

    Exception calling “Join” with “2” argument(s): “Value cannot be null.
    Parameter name: values”
    At C:\users\Administrator\Desktop\Get-ExchangeEnvironmentReport.ps1:585 char:9
    + $ExtNames = [system.String]::Join(“,”,$ExtNames)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException

  10. Steve,

    I am running the following script on Exchange PowerShell and I am not getting prompted for Task Scheduler Password. Everything else works.

    .\Get-ExchangeEnvironmentReport -HTMLReport c:\ExchangeReport.html -SendMail:$true -MailFrom:system@domain.com -MailTo:user@domain.com -MailServer:webmail.domain.com -ScheduleAs:domain\admin

    Anything that I am doing wrong?

  11. Hi Steve,
    i have set the $ServerFilter option to look at my server naming convention, but the report still tries to scan the entire org, i changed “*” to “server0*” for exampple, what else am i missing?

    regards

  12. Steve,
    Brilliant script sir! Unfortunately, I need some tutoring on how to accomplish the following:
    – Append the DATE to both email Subject and HTMLReport
    – Filter servers parsed (wildcard won’t work due to naming convention)
    – Either exclude multiple servers (“Ex2, Ex4”) from the report, but still parsing Ex1, Ex3, & Ex5
    – Or specifying just the server to parse “Ex1, Ex3, Ex5”

  13. Hi Steve, thank you for your script.
    It run successfully when I enter directly into Exchange Power Shell:
    D:\Scripts>.\Get-ExchangeEnvironmentReport.ps1 -HTMLReport report.html
    But it fail when I try to run it in cmd:
    D:\Scripts>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command “D
    :\Scripts\Get-ExchangeEnvironmentReport.ps1 -HTMLReport report.html”
    Exchange Management Shell cannot be loaded
    At D:\Scripts\Get-ExchangeEnvironmentReport.ps1:825 char:3
    + throw “Exchange Management Shell cannot be loaded”
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (Exchange Manage…annot be lo
    aded:String) [], RuntimeException
    + FullyQualifiedErrorId : Exchange Management Shell cannot be loaded

    • I fixed it, I should edit Exchange installation path from line 817 to 825 in script file, cause I use Exchange 2013.

  14. Steve,

    Great work on this script.

    I used it for the last few years and worked great. I am just wondering where and how do I setup the parameters if I want to email the report on a daily basis. I am a bit confused to where to set the parameters, a good example will help me.

  15. dumbest question you will ever get… How should I go about modifying your awesome report so that it just data dumps to CSV instead? I will probably need to split it up into multiple ps1 files to do a data dump of each table of information into separate CSV files. Any help is much appreciated!!!

  16. Hi Steve,
    It does seem script not working with mount points on Exchange servers. I get the details almost all the details except database names, amount of mailboxes per database, size of databases and etc.

  17. I’ve tried using the above suggestions, like what Daren and Ian, however I can’t seem to get the script to run with a scheduled task even with the ExecutionPolicy Bypass option. I’ve tried a a few different arguments as well, like:

    PowerShell.exe -ExecutionPolicy Bypass -PSConsoleFile “D:\Program Files\Microsoft\Exchange Server\V14\Bin\ExShell.psc1” -Command “. ‘C:\Scripts\Get-ExchangeEnvironmentReport -HTMLReport C:\Scripts\ExchangeReport.html -SendMail:$true -MailFrom:server@mancan.com -MailTo:something@mancan.com -MailServer:something.mancan.com'”

    But it’s not working. Running Exchange 2010 SP1, the scheduled task is on that server with allow whether user is logged in or not and highest priority. Any thoughts?

  18. Hi Steve, I got here cause I needed to get a good report about a Exchange 2007 environment and ExBPA is not a good one to get the right info
    I have a problem already reported here

    Exception calling “Join” with “2” argument(s): “Value cannot be null.
    Parameter name: value”
    At C:\Users\tisistemas\Desktop\Get-ExchangeEnvironmentReport.ps1:584 char:42
    + $IntNames = [system.String]::Join <<<< (",",$IntNames)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Exception calling "Join" with "2" argument(s): "Value cannot be null.
    Parameter name: value"
    At C:\Users\tisistemas\Desktop\Get-ExchangeEnvironmentReport.ps1:585 char:42
    + $ExtNames = [system.String]::Join <<<< (",",$ExtNames)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Exception calling "Join" with "2" argument(s): "Value cannot be null.
    Parameter name: value"
    At C:\Users\tisistemas\Desktop\Get-ExchangeEnvironmentReport.ps1:584 char:42
    + $IntNames = [system.String]::Join <<<< (",",$IntNames)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Exception calling "Join" with "2" argument(s): "Value cannot be null.
    Parameter name: value"
    At C:\Users\tisistemas\Desktop\Get-ExchangeEnvironmentReport.ps1:585 char:42
    + $ExtNames = [system.String]::Join <<<< (",",$ExtNames)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    I get a chopped report only with the first part and DBs info but no info about virtual directories or other things. I downloaded the lasted version 1.6.1.
    Also, I have Exchange 2007 SP3 without UR, but the report says that I have UR8.
    Do you know what could be happening?

    Thanks!

  19. I have added a command to the Get-MailboxDatabase commands to reduce the errors on unmounted databases.

    | Get-MailboxDatabaseCopyStatus | where {$_.Status -eq “mounted”}

  20. Is it possible to pull the following info out of what is already being collected? I have a script that I can run and it gets me this info, I have added to the 1.61 version of your script, and it gives me the data, but only pulls it from the 2013 Exchange servers. When I run it as a standalone, it pulls from the 2010 servers also.

    Number of Databases Total DB Size Average DB Size Largest DB Size Smallest DB Size

    The script is below, along with results.

    $MailboxStorageStats = get-mailboxdatabase -IncludePreExchange2013 | foreach-object{select-object -inputobject $_ -property *,@{name=”MailboxDBSizeinGB”;expression={[math]::Round(((get-item (“\\” + $_.servername + “\” + $_.edbfilepath.pathname.replace(“:”,”$”))).length / 1GB),2)}}} | Sort-Object mailboxdbsizeinGB -Descending | measure-object -Property mailboxdbsizeinGB -Sum -Maximum -Minimum -Average
    $MBXCount = “{0:n0}” -f ($mailboxcount1.Count)
    $DLCount = “{0:n0}” -f ($DLCount1.Count)
    $MBXDatabaseCount = “{0:n0}” -f ($MailboxStorageStats.Count)
    $MBXDatabaseSizeTotal = “{0:n2}” -f ($MailboxStorageStats.Sum)
    $MBXDatabaseAverage = “{0:n2}” -f ($MailboxStorageStats.Average)
    $MBXDatabaseLargest = “{0:n2}” -f ($MailboxStorageStats.Maximum)
    $MBXDatabaseSmallest = “{0:n2}” -f ($MailboxStorageStats.Minimum)

    $file = “Test.html”

    Add-content $file “”
    Add-content $file “Exchange Database Statistics”
    Add-content $file “Generated $((Get-Date).ToString())”
    Add-content $file “on server $server”
    Add-content $file “Number of DatabasesTotal DB SizeAverage DB SizeLargest DB SizeSmallest DB Size”
    Add-content $file “$MBXDatabaseCount”,”$MBXDatabaseSizeTotal GB”,”$MBXDatabaseAverage GB”,”$MBXDatabaseLargest GB”,”$MBXDatabaseSmallest GB”
    Add-content $file “”

    Results running as standalone:
    Number of Databases Total DB Size Average DB Size Largest DB Size Smallest DB Size
    76 10,328.00 GB 135.89 GB 680.00 GB 0.00 GB

    Results when included in the 1.61 script:
    Number of Databases Total DB Size Average DB Size Largest DB Size Smallest DB Size
    11 696.02 GB 63.27 GB 680.00 GB 0.00 GB

  21. Has anybody tried the option ServerFilter?

    For me (Exchange 2010 SP3 UR11 DAG on Server 2008R2) it does not count the mailboxes anymore!?
    I’ve checked the script and found
    – there is no Server for the result of Get-Mailbox
    – use ServerName instead

    So I’ve changed two lines in Section _UpProg1 10 “Getting Mailboxes” and _UpProg1 60 to $_.ServerName
    -> $Mailboxes = [array](Get-Mailbox -ResultSize Unlimited) | Where {$_.ServerNAME-like $ServerFilter}
    and voila the html contains the number of filtered mailboxes.

  22. Today I noticed that 3 of our Mailbox servers in Montana hadn’t had a full backup since the 10th. I contacted the tech onsite, and he sent me a screen shot of the backups as being successful every day. I ran the script again, it then reported that the backups had run this morning about 3 hours before the script ran. I noticed that all of the error checking seems to be set to silently continue. Is there an easy way to report on failed connections?

    Ken

  23. Hello Steve, Thank you very much :-).

    Having an issue where the outputted html report shows site information but not database, I’m sure I am doing something dumb any help is appreciated.

    2010 SP3 UR9, Server 2008 R2 Std.

  24. Pingback: Top 5 Tips for Migrating to Office 365 | Essential

  25. Running this in our test environment which is Exchange 2010 SP3 and using powershell 2.0 I’m getting:

    Exception calling “Join” with “2” argument(s): “Value cannot be null.
    Parameter name: value”
    At D:\Install\Get-ExchangeEnvironmentReport.ps1:585 char:42
    + $ExtNames = [system.String]::Join <<<< (",",$ExtNames)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

    Using Version 1.6.1 of your script, any ideas?

    GREAT WORK.

    • Hey Guys, I’m running a hybrid with exchange 2010 & 2013 CU8. I kept on receive the error below and the report doesn’t show enough information. Can someone help?

      Cannot process argument transformation on parameter ‘Server’. Cannot convert value “removed” to type “Microsoft.Exchange.Configuration.Tasks.ServerIdParameter”. Error: “Cannot
      convert hashtable to an object of the following type: Microsoft.Exchange.Configuration.Tasks.ServerIdParameter. Hashtable-to-Object conversion is not supported in restricted
      language mode or a Data section.”
      + CategoryInfo : InvalidData: (:) [Get-OwaVirtualDirectory], ParameterBindin…mationException
      + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-OwaVirtualDirectory
      + PSComputerName : pbmbx01w.secure.protective.com

      Cannot process argument transformation on parameter ‘Server’. Cannot convert value “Removed” to type “Microsoft.Exchange.Configuration.Tasks.ServerIdParameter”. Error: “Cannot
      convert hashtable to an object of the following type: Microsoft.Exchange.Configuration.Tasks.ServerIdParameter. Hashtable-to-Object conversion is not supported in restricted
      language mode or a Data section.”
      + CategoryInfo : InvalidData: (:) [Get-WebServicesVirtualDirectory], ParameterBindin…mationException
      + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-WebServicesVirtualDirectory
      + PSComputerName : “removed”

    • replace lines 582-590:
      $IntNames = $IntNames|Sort -Unique
      $ExtNames = $ExtNames|Sort -Unique
      $IntNames = [system.String]::Join(“,”,$IntNames)
      $ExtNames = [system.String]::Join(“,”,$ExtNames)
      if ($IntNames)
      {
      $IntNamesText=”Internal Names: $($IntNames)”
      $ExtNamesText=”External Names: $($ExtNames)”
      }

      with:
      $IntNames = $IntNames|Sort -Unique
      $ExtNames = $ExtNames|Sort -Unique

      if ($IntNames)
      {
      $IntNames = [system.String]::Join(“,”,$IntNames)
      $IntNamesText=”Internal Names: $($IntNames)”
      }

      if ($ExtNames)
      {
      $ExtNames = [system.String]::Join(“,”,$ExtNames)
      $ExtNamesText=”External Names: $($ExtNames)”
      }

  26. Pingback: New version of the Exchange Environment Report available now | Steve Goodman's Exchange & Office 365 Blog

  27. hi. thanks for the script. one question: i have two mbx in a DAG, the report would give the number of mailboxes only on one mbx server. the other mbx server have 0 mailboxes. why is that?

  28. Pingback: PowerShell Scripts for your Exchange and Office 365 Toolkit

  29. can I add CC in command?

    -SendMail:$true -MailFrom:you@example.com -MailTo:you@example.com -MailServer:smtp.example.com -ScheduleAs:DOMAIN\user

  30. Running on EXCH 2007 error as below –>

    Exception calling “Join” with “2” argument(s): “Value cannot be null.
    Parameter name: value”
    At C:\…\Get-ExchangeEnvironmentReport.ps1:567 char:42
    + $IntNames = [system.String]::Join <<<< (",",$IntNames)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

  31. Hello,

    There is a bad display of echange 2010 SP3 RU 10 version if other RU has been applied before this one. To resolve this, just add [int] in front of variable compare on line 356 in v1.5.8 to evaluate them as numerical and not as string : if ([int]$tRU -ge [int]$RollupLevel) { $RollupLevel=$tRU; $RollupVersion=$tRUV }

  32. Dear, I have the problem in my Exchange 2007:

    Exception calling “Join” with “2” argument(s): “Value cannot be null.
    Parameter name: value”
    At C:\scripts\Get-ExchangeEnvironmentReport.ps1:567 char:42
    + $IntNames = [system.String]::Join <<<< (",",$IntNames)
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

      • Hello,

        I have the same error : Join” with “2” argument(s): “Value cannot be nul”.

        Error message :

        Exception calling “Join” with “2” argument(s): “Value cannot be null.
        Parameter name: value”
        At E:\Program Files\Microsoft\Exchange Server\V14\Scripts\Get-ExchangeEnvironmentReport.ps1:584 char:42
        + $IntNames = [system.String]::Join <<<< (",",$IntNames)
        + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException

        Exception calling "Join" with "2" argument(s): "Value cannot be null.
        Parameter name: value"
        At E:\Program Files\Microsoft\Exchange Server\V14\Scripts\Get-ExchangeEnvironmentReport.ps1:585 char:42
        + $ExtNames = [system.String]::Join <<<< (",",$ExtNames)
        + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException

        With :

        1.6.1 script's version.
        Exchange 2010 SP3 UR10
        Windows Server 2008 R2 Ent Service Pack 1

        many thanks,

  33. Pingback: Admin Admin Podcast #027 Show Notes – Nmaping it all up | The Admin Admin Podcast

  34. Any thoughts whether this report might be able to include edition and perhaps total # of Active Sync devices?

  35. Hi, I\m running Exchange 2013 RU9 and script not showing exchange version. Please contact me i will send you screenshot. Thank you

  36. Hi Steve,

    This script is a life saver in our daily checks. Thanks for the great work.
    Having some issues with the latest Rollup 10 that we updated Exchange 2010 too. The script still thinks we are on RU9?

    How do I rectify this in the script?

    Also how would I sort and list the databases by db name instead of sorted by which server they are mounted on?

    Many thanks

    Wes

  37. Pingback: Top 5 Tips for Migrating to Office 365 - Essential Computing

  38. I’m running this script from a workstation with Exchange 2013 tools installed. I get errors, and while the HTML report is generated and the DAG information is displayed, there are no databases listed and no details about the databases

    • Hiya, it should work fine with Remote PowerShell (that’s what I assume when you say 2013 tools on a workstation) but it is designed to run on-server. What errors do you get? Do you have connectivity to all servers?

      • Hi, I am trying to run this on a windows 8.1 machine that has the 2013 exchange tools installed on it too, I get some information in the report such as the server and DAG names, but none of the exchange information such as mailboxes, server versions, disk space etc all of the fields are blank. If I run it from the exchange server directly it is fine and has all of the info within the report. How can I get this to run from a workstation with the 2013 exchange tools installed rather than from the actual exchange server?

  39. Steve, Great Utility! Definitely useful for sizing when looking to upgrade, as well as current state snapshot.

    Any thoughts to adding a more detailed outputs. For instance giving advanced options to gather URI configurations, certificate, send/receive connector settings, etc?

    I might give it a go and add these things in as well either through separate powershell scripts or expand on this one.

    Thanks!

    • Hi Ken, I’ve thought about it – I wonder if a more detailed PDF report would be more appropriate if that were the case as it would be hard to show the info concisely

  40. Great script/information…if I just wanted Database Availability Group Members and not the other parts how would i do that?

    • Hi David, it is spit into commented sections at the end that generate HTML in functions (IE a named command that makes each table of data), so you should be able to delete the bits you want easily.

  41. I ran this manually and get the HTML file in the specified folder, but the email fails with this PS error message:

    Send-MailMessage : Service not available, closing transmission channel. The server response was: 4.3.2 Service not
    available

    • If you’re talking about seeing something like “Exchange 2010 SP3 UR8 v2” even though UR10 is installed, it’s a bug in the code with the way strings are evaluated. The following line fails because the string “10” is not greater than or equal to “8” even though the int values are:

      if ($tRU -ge $RollupLevel) { $RollupLevel=$tRU; $RollupVersion=$tRUV }

      change the line to:

      if ([int]$tRU -ge [int]$RollupLevel) { $RollupLevel=$tRU; $RollupVersion=$tRUV }

  42. Same here, Exchange 2013 CU and Exchange 2010 SP3, doesnt display the 2013 info, gives databases and everything else but not the version of exchange 2013.

    • just search and add whats missing i the script.
      $ExSPLevelStrings = @{“0” = “RTM”
      “1” = “SP1”
      “2” = “SP2”
      “3” = “SP3”
      “4” = “SP4”
      “CU1” = “CU1”
      “CU2” = “CU2”
      “CU3” = “CU3”
      “CU4” = “CU4”
      “CU5” = “CU5”
      “CU6” = “CU6”
      “CU7” = “CU7”
      “CU8” = “CU8”
      “CU9” = “CU9”
      “SP1” = “SP1”
      “SP2” = “SP2”}

  43. exchange 2010 SP3 RU4

    runs fine from powershell but when i manually run it from Task scheduler nothing happens. no errors from task

    • I’ve got this script working via a schedule task by using Steve’s command to create the initial scheduled task. Then went in to edit as follows:
      1. In the Program/script field: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
      2. In the Add arguments field: -command “. ‘C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto; pushd C:\report; C:\report\Get-ExchangeEnvironmentReport.ps1 -HTMLReport C:\report\report.html -SendMail:$true -MailFrom:emailaddress -MailTo:emailaddress -MailServer:servername”

      Make the appropriate changes to add your email address and servername, and the location of the actual ExchangeEnvironmentReport.ps1 file.

    • I have a Task Scheduler that runs with the following:
      Security options: specify an account with permissions to run the scripts successfully, “run whether the user is logged on or not”
      Action: start a program
      Program/script: powershell
      Arguments: “-executionpolicy bypass -file c:\get-exchangeenvironmentreport.ps1 -HTMLReport c:\exchangeenvironmentreport.html” (no quotes)

      If you’ve configured the following policy, you will need to relax the setting:
      “Network access: Do not allow storage of passwords and credentials for network authentication”
      https://technet.microsoft.com/en-us/library/jj852185%28v=ws.10%29.aspx

Comments are closed.