email notification to admin after a successful policy execution

New Contributor II

hi all -

without setup of smtp on the mac, is there an option to send an email notification to an email address after policy execution?



Contributor II

Well I can clarify - you don't need SMTP setup on the client machine
Just SMTP setup on your server…

Your server receives a 'success' or 'fail' response to the policy install on the client machine(s) and that success state can be reported back to you via an email from the server.

While there are alternate methods of doing this - any of them - if they are to send an email in the process, would have at some point to know the email address of the SMTP server to send the email to…
Rather then use some complicated scripting - it's simplest to just use the Casper built-in mechanisms.
You can send an email on state change of membership of a smart group.
I would use that method.

Hope that helps…

Legendary Contributor II

Only way I know of is with a script that runs after the policy which uses the mail command in Unix. Though there are some other more advanced ways of sending mail from the command line, but I think most others would need some kind of smtp information.

Of course, since policies right now can't really send back an exit code to a script, you would need to craft your script in a way that would check the success or failure status of the policy in question. Meaning, you need to know how to determine if the policy actually worked or not, because I assume the purpose of this is to send an email either on failures, or just an email that would tell you (or the recipient) whether the policy ran successfully or not, correct?