8 Replies Latest reply: Sep 12, 2013 5:46 PM by mshearer RSS

Sending email from Snap Creator Windows Server - how?

mshearer
Currently Being Moderated

I am attempting to send an email form Snap Creator and these commands work from the command line or from a batch file, however when I try to use the command via the event configuration the job gets to the event task and just stops at that point and never returns.  I have tried changing the SC server process to start as a service with a domain account rather than the local system account and have the same behavior.  So has anyone done this before or what exactly am I missing here?  This I would say is a powershell issue, but I am not 100% sure on that and just wanted to see if anyone else has some feedback.  Thank you.

 

###########################

### Event Configuration ###

###########################

NTAP_ASUP_ERROR_ENABLE=N

SENDTRAP=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -command "& {Send-MailMessage -to mattshearer@lab.stl -from snapcreator@dfm.lab.stl -subject MSG -SmtpServer smtp.lab.stl}"

SUCCESS_TRAP=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -command "& {Send-MailMessage -to mattshearer@lab.stl -from snapcreator@dfm.lab.stl -subject MSG -SmtpServer smtp.lab.stl}"

SUCCESS_MSG=INFO: NetApp Snap Creator Framework Backup for %SNAME ACTION: %ACTION POLICY: %SNAP_TYPE finished successfull

 

 

Just to make sure everything was working I confirmed that I could send events to windows events - https://communities.netapp.com/docs/DOC-9247

 

Notes

SC Version 3.6.0 from the NOW site

Windows Version 2008 R2 Enterprise SP1

  • Re: Sending email from Snap Creator Windows Server - how?
    Siva Ramanathan
    Currently Being Moderated

    Hello Matt,

    Please try to include -Credential<PSCredential> to your powershell script and supply username along with other options.

    (like "User01" or "Domain01\User01")

     

    I suspect, snapcreator as such is unable to send emails, and having a domain account like domain\username might break thru.

     

    Thanks,
    Siva Ramanathan

    Snapcreator Community Moderator

  • Re: Sending email from Snap Creator Windows Server - how?
    mshearer
    Currently Being Moderated

    Ok, so I am closer now than I was before, the SUCCESS_TRAP works, the SENDTRAP does not, basically the message needs to be single quoted to be interpreted properly by powershell, so I manually single quoted the SUCCESS_MSG, now trying to figure out how to do that for the MSG variable...

     

    Changes:

    -Need to have the Snap Creator service started by a domain user rather than local user

    -Need to have powershell.exe in your path

    -Had to place single tick quotes around the message in the SUCCESS_MSG variable

     

    ###########################

    ### Event Configuration ###

    ###########################

    NTAP_ASUP_ERROR_ENABLE=N

    SENDTRAP=powershell.exe -noprofile -command "& {Send-MailMessage -to mattshearer@lab.stl -from snapcreator@dfm.lab.stl -subject %MSG -SmtpServer smtp.lab.stl}" < nul

    SUCCESS_TRAP=powershell.exe -noprofile -command "& {Send-MailMessage -to mattshearer@lab.stl -from snapcreator@dfm.lab.stl -subject %SUCCESS_MSG -SmtpServer smtp.lab.stl}" < nul

    SUCCESS_MSG='INFO: NetApp Snap Creator Framework Backup for %SNAME ACTION: %ACTION POLICY: %SNAP_TYPE finished successfull'