Is there a script to monitor Exchange 2013 and get daily email report of health?
Is there a script to monitor Exchange 2013 and get daily email report of health? I tried Paul's poweshell script but it only gives option for monitor when Exchange is up as powershell is using same SMTP to send email alert, which wont work if the services on server is down.
SCOM has been replaced with SCCM which means I might to deployed entire SCCM 2012 package to get the monitoring feature of Exchange and GSX might not be cost effective to monitor Exchange with only 2 DAB members
Exchange
Last Comment
pchettri
8/22/2022 - Mon
Sudeep Sharma
Hi PChetrri,
.......as powershell is using same SMTP to send email alert, which wont work if the services on server is down.............
Why don't you modify the script and send the email through gmail?
This should keep you going. If you really want to monitor the health of your Exchange then invest in a tool such as Splunk with Exchange monitoring module or SolarWinds.
pchettri
ASKER
I have used the link to create script and task. What I am trying to find out is how to add gmail as sender and receiving email address instead of Exchange. How does the authentication happens, if I am using gmail as sender too.
I have had success with Steve to get HTML but I had issues with Paul to get in HTML though it does show in powershell correctly. I have been trying fix that for couple of days. I may have to post of paul's forum with error. I did have to change exchanger server powershell virtual link to constant entry instead of using call method to make Paul's method at least in powershell. For Steve it does not work in remotesigned and it has to be unrestricted
you mean call this script from existing report script for Exchange by Steve?
pchettri
ASKER
Does the above script needs to be saved as PS1 for email reporting to run?
Mohammed Khawaja
All PowerShell scripts must be saved as .ps1. From the original script, remove the part that tries to email re file with the new script or just have the first script save the report to a file and then use the second script to email. I am not at a PC but I could modify the script for you on Wednesday.
got it I have change the c:\Filename.FileType" to original html report file
pchettri
ASKER
I am getting this error now, looks like gmail does not allow plain text password authentication -
Send-MailMessage : The SMTP server requires a secure connection or the client
was not authenticated. The server response was: 5.5.1 Authentication Required.
Learn more at
At C:\cert\email.ps1:12 char:1
+ Send-MailMessage -To $EmTo -From $EmFrom -Body $Bod -Subject $Subj
-Attachments ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:Sm
tpClient) [Send-MailMessage], SmtpException
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.Send
MailMessage
Actually, the script posted by Mohammed Khawaja is working after I disabled two factor authentication from gmail. I think your script was missing password variable to authenticate to gmail. Mohammed Khawaja has complete script for email only that I could use to call the report saved in C drive and it works with Steve get excahgehealth script
My scripts run fine in powershell but it does not generate HTML or email. It only shows status directly on powershell.
I copied modified script from Sudeep but I started getting unnecessary error with comment section. So only copied and modified the email function call and reference to email section using my gmail account and authentication. Script runs fine without error, it just does not generate email or HTML
Have you really tested on gmail or external email, as gmail wont work without plain text password conversion as done by Muhammad in previous comment and I get error
Exception calling "Send" with "1" argument(s): "The SMTP server requires a secure connection or the client was not
authenticated. The server response was: 5.5.1 Authentication Required. Learn more at"
At C:\scripts\paul-ExchangeServerHealth.ps1:2113 char:4
Also, I have disabled all security from gmail and tried both port with and without SSL authetication
pchettri
ASKER
Sudeep Sharma script finally worked it was authentication issue from gmail which worked after disabling feature and adding 587 port back with SSL authentication
.......as powershell is using same SMTP to send email alert, which wont work if the services on server is down.............
Why don't you modify the script and send the email through gmail?
You just need to modify the email module.
Sudeep