Jump to content

Recommended Posts

Posted

I have added a powershel script to Pulseway and scheduled it.

On the Server the script is running well, but with Pulseway it has a problem to send a mail with the PS command: Send-MailMessage.

+          Send-MailMessage -To $user.EmailAddress -BCC $MailSender -Fr ...
+          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.Mail.SmtpClient:Sm 
   tpClient) [Send-MailMessage], SmtpException
    + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.Send 
   MailMessage

The command is: Send-MailMessage -To $user.EmailAddress  -From $MailSender -SmtpServer $SMTPServer -Subject $Subject -Body $EmailBody

 

What is the reason for the error ??

 

I use this script:

https://4sysops.com/archives/a-password-expiration-reminder-script-in-powershell/

 

  • 2 weeks later...
  • Staff
Posted

Hi @Christian Kiesel,

Please verify that you can access SMTP server without providing user credentials?

Please try to use the script from this post.

Note: If the PowerShell Impersonation is not configured, the PowerShell scripts run using the System account. 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...