User attempting to use an Office 365 Exchange account, user is receiving error
"Sending Email Failed: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM (Outlook exchange servers here)
WORKAROUND:
User can use Alarm Action trigger PS script to send email with Office 365 account inside. Because PS script will run against be monitored instances, make sure PS version is 3.0 and has linked Windows connection.
PowerShell Script (PS)
========================================================================================
$smtp="smtp.office365.com"
$from="user@name.onmicrosoft.com"
$to="user@domain.com"
$subject="{{MESSAGE}}"
$user="user@name.onmicrosoft.com"
$pwd=ConvertTo-SecureString-String"password"-AsPlainText-Force
$cred=New-Object-TypeNameSystem.Management.Automation.PSCredential-ArgumentList$user,$pwd
$body="Connection: {{CONNECTION_NAME}}
Time: {{TIME}}
Severity: {{SEVERITY}}
{{ALARM_NAME}}: {{MESSAGE}}"
Send-MailMessage-From$from-To$to-SmtpServer$smtp-Subject$subject-Body$body-Credential$cred-UseSsl-Port587
====================================================================
STATUS:
Issue fixed in the current release of Spotlight on SQL Server Enterprise. Latest version of Spotlight can be downloaded from here.
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center