Test-ExchangeServerHealth.ps1 v1.2 Released

I have just uploaded version 1.2 of the Test-ExchangeServerHealth.ps1 script.

This version includes a number of important bug fixes, as well as adding the DAG health check (from Get-DAGHealth.ps1).

You can download the new version here.

Please continue to report bugs and make feature requests in the comments on that post.

About Paul Cunningham

Paul is a Microsoft Exchange Server MVP and publisher of Exchange Server Pro. He also holds several Microsoft certifications including for Exchange Server 2007, 2010 and 2013. Connect with Paul on Twitter and Google+.

Comments

  1. Thanks Paul!!
    the script is really useful and saves me a lot of time during daily activity.
    Really a great job!!

  2. I am getting really frustrated the script via Task Scheduler.

    Environment:
    Windows 2008 R2
    Exchange 2010

    Problem >>
    I have two environments:
    Lab Environment: It works via Task Scheduler and when I run manually.
    Production Environment: Only if I run the scripts manually. Not via Task Scheduler.

    The user I am using on my production environment is a member of Domain Admins + Organization Management.
    If I log in the production environment I can run my scripts manually successfully.

    How my Task is configured:
    Run whether user is logged or not – checked
    Run with high privileges – checked

    Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Argument: -Version 2.0 -NonInteractive -WindowsStyle Hidden -executionpolicy unrestricted -command “. ‘c:\Program Files\Microsoft\Exchange Server\v14\bin\RemoteExchange.ps1′; Connect-ExchangeServer -auto; c:\scripts\Test-ExchangeServerHealth.ps1 -Log -SendEmail”

    No matter what I do, the task seems to complete(according the history of the task – no erros whatsoever) but it does not send the report.

    Initially I thought was my SMTP server, but if I run the script manually works….like:
    .\Test-ExchangeServerHealth.ps1 -Log -SendEmail”

    I already ran:
    Set-ExecutionPolicy Unrestricted
    Set-ExecutionPolicy RemoteSigned
    No difference!

    If I run manually it works. The same happens with another script (Get-ExchangeEnvironmentReport). If I run manually it works. If I try to run via Task Scheduler, nothing happens.
    I reckon it is a permission issue. But to be honest I am running out of ideas.

    Any ideas?
    Please help ;-(

    • My task scheduler argument is just:

      -command “C:\Scripts\ExchangeServerHealth\Test-ExchangeServerHealth.ps1 -Log -SendEmail”

      You don’t need to call remoteexchange.ps1 and connect-exchangeserver. The script handles that for you.

      Other than that, when in doubt just open a cmd.exe and paste in the full one-liner command you’re trying to run via Task Scheduler (eg powershell.exe -command “blah”) and see if that gives you any more clues.

      • Thanks Paul
        I managed to have it working using the following argument:

        -command “. ‘C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1′; Connect-ExchangeServer -auto; c:\Scripts\Test-ExchangeServerHealth.ps1 -Log -SendEmail”

        I will leave like this now. :-)

Leave a Comment

*

We are an Authorized DigiCert™ SSL Partner.