Use a regular mailbox-enabled account or create a specific receive connector for just that server and allow anonymous access from just that server
https://learn.microsoft.com/en-us/exchange/mail-flow/connectors/custom-receive-connectors?view=exchserver-2019#scenario-3-receive-messages-from-a-server-service-or-device-that-doesnt-use-exchange
Send-MailMessage with Computer Account
Hello,
I'm creating some script for some action in Windows Server. The script is executed with the "BUILTIN\SYSTEM" account.
This script need to send the result of the script with the command "Send-MailMessage", I want use the computer account to send the mail.
I don't allow on my exchange server anonymous connection.
Any idea?
Thank's for the help!
2 answers
Sort by: Most helpful
-
Andy David - MVP 155.4K Reputation points MVP
2021-06-01T11:59:15.05+00:00 -
Rich Matheisen 47,786 Reputation points
2021-06-01T14:55:54.117+00:00 In addition to Andy's suggestion, you can store an encrypted password in a file and use it to create a credential. Use the credential (for an unprivileged user, of course) in the Send-MailMessage.
Here's an example (it uses the old technique of creating the SMTP client, but you can ignore that):
powershell-how-encrypt-and-store-credentials-securely-use-automation-scripts