Permabanned
- Joined
- 28 Dec 2009
- Posts
- 13,052
- Location
- london
I am trying to set up some powershell scripts to automatically send the reports to the IT mailbox.
The two reports:
http://gallery.technet.microsoft.com/office/Exchange-DAG-Replication-d8e99705
http://www.stevieg.org/2011/06/exchange-environment-report/
The second script has a built in mail and scheduler options but when i try to make it send an email i get smtp authentication error.
This is the error message. Obviously i updated the command with the relevant site specific details.
Now in previous version of exchange I would right click on the smtp protocol and have to add other servers ip address to the allow list in order for it to use smtp. But I am trying to send an email from the exchange server itself and i would have thought the exchange server would be added automatically to smtp allow list?
I did find this guide for adding a new relay connector but that is more relevant for relaying from different servers.
http://exchangeserverpro.com/how-to-configure-a-relay-connector-for-exchange-server-2010/
Any idea how i can get these powershell scripts to send email?
The two reports:
http://gallery.technet.microsoft.com/office/Exchange-DAG-Replication-d8e99705
http://www.stevieg.org/2011/06/exchange-environment-report/
The second script has a built in mail and scheduler options but when i try to make it send an email i get smtp authentication error.
Code:
.\Get-ExchangeEnvironmentReport -HTMLReport c:\report.html -SendMail:$true -MailFrom:[email protected] -MailTo:[email protected] -MailServer:smtp.example.com
This is the error message. Obviously i updated the command with the relevant site specific details.
Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server respons
e was: 5.7.1 Client was not authenticated
At C:\PowerShellScripts\Get-ExchangeEnvironmentReport.ps1:996 char:18
+ Send-MailMessage <<<< -Attachments $HTMLReport -To $MailTo -From $MailFrom -Subject "Exchange Environment Report
" -BodyAsHtml $Output -SmtpServer $MailServer
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpExcept
ion
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage
Now in previous version of exchange I would right click on the smtp protocol and have to add other servers ip address to the allow list in order for it to use smtp. But I am trying to send an email from the exchange server itself and i would have thought the exchange server would be added automatically to smtp allow list?
I did find this guide for adding a new relay connector but that is more relevant for relaying from different servers.
http://exchangeserverpro.com/how-to-configure-a-relay-connector-for-exchange-server-2010/
Any idea how i can get these powershell scripts to send email?
Last edited: