Exchange 2013: Health Check Script
Health check is most important to do to prevent any production outage and data loss. I have come cross a great script which is going to help you in reducing your effort so make use of it and sip your coffee in peace.
This script was originally written by Manish Sharma for Exchange 2007 then modified by Powershell MVP Vikas Sukhija for Exchange 2010. Vikas is not limited to Powershell but he also manages Sharpoint, Lync and Active Directory.
Now I have tested and modified many things in it for exchange 2013 and ease of system admins. I am republishing it.
This script will give you 2 outputs as shown below:
- Email output: Script will send an email to your designated email address with content in the body of the email.
2. Attachment: Script will one htm file which will be attached to the email as well. At this same time this file will be located in the mentioned directory.
Point to remember is to run the script from the same directory where we have copied the script. It means you have to change the directory before running the script.
When you will download the script, it is ready to be used with your inputs and couple of changes.
Download the script from here. – https://gallery.technet.microsoft.com/Exchange-2013-DAG-and-5f9dad03
Changes: There are 2 changes required.
- Right click and select edit.
Update the report file path. It should be the same path as script directory
$reportpath = “c:temp2013Report.htm”
3. Update one of the Exchange mailbox role server’s powershell virtual directory internalurl here
$url = “http://servername.domain.com/Powershell”
4. Save the script and run it from Exchange management shell
Input: When you will run the script, following 3 inputs will be required to send the report.
- SMTP server FQDN
- Sender email id
Recipient email id
You can add this script to the scheduled task and schedule to run it as per company’s health check policy.
If you like the script and decided to run it every day then it is better to update the following 3 parameter as well. Then add to the scheduled tasks.
$smtphost = SMTP SERVER FQDN
$from = Sender email address
$to = Recipient email address
Save and close the script and you are good to go.
Feel free to give us feedback if this helps.
Microsoft MVP | Exchange Server
Tweet me @PrabhatNigamXHG