Client Management Suite

 View Only
  • 1.  Possible to email the output of a (Server Job) script to me?

    Posted Mar 08, 2011 11:45 AM

    I have a task that I'm running on the main NS.  I'd like to be able to email the output of that task to myself.  However, I don't see any obvious way to save the script output and dump it into an email.  Is this possible?



  • 2.  RE: Possible to email the output of a (Server Job) script to me?

    Posted Mar 08, 2011 01:29 PM

    Are you wanting to run a task and return the status/success/failure of that task to yourself?  Or is this a script that reports back a value to the NS?  Or..?



  • 3.  RE: Possible to email the output of a (Server Job) script to me?

    Posted Mar 08, 2011 03:42 PM

    Its a batch file that returns a list of computer names from AD.  I need that list emailed to me.



  • 4.  RE: Possible to email the output of a (Server Job) script to me?

    Posted Mar 08, 2011 06:24 PM

    I assume you're running this on the NS as a server job for the scheduling benefit of it all.  Would it be easier to rewrite the script so that it e-mails the results, and the NS continues to handle scheduling?

    Or, if the data in AD is already in the NS, you could schedule the report to run against particular AD data already present in the NS.

    But I can't think of a way to have the NS run a script which provides output to the NS which is then incorporated into an e-mail.



  • 5.  RE: Possible to email the output of a (Server Job) script to me?

    Posted Mar 08, 2011 09:34 PM

    Store the output of the data into a custom inventory table. The setup an SQL report that displays the results, and then have an automation policy email the results of that table to you on a specified date/time.

    We do it all the time!

    (let me know if you need more information here, I'm just a bit busy at the moment)



  • 6.  RE: Possible to email the output of a (Server Job) script to me?

    Posted Mar 11, 2011 03:45 PM

    Yeah, if you could get me more details on how to do that, that would be awesome!



  • 7.  RE: Possible to email the output of a (Server Job) script to me?

    Posted Mar 21, 2011 11:00 AM

    Bump?



  • 8.  RE: Possible to email the output of a (Server Job) script to me?

    Posted Mar 25, 2011 12:43 AM

    .. and add it to the end of your script.

    Unless you are doing it a different way? Let me know.

     'Variables
    Set objEmail = CreateObject("CDO.Message")
    
    strEmailFrom = "Notifications@NS7"
    strEmailTo = "Your.Email@Workplace.com"
    strEmailSubject = "Automated Report"
    strEmailTextbody = "Test"
    strEmailSmtpserver = "YourInternalSMTPServer"
    
    'Create email message
    objEmail.From = strEmailFrom
    objEmail.To = strEmailTo
    objEmail.Subject = strEmailSubject
    objEmail.Textbody = strEmailTextbody
    objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strEmailSmtpserver
    objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    objEmail.Configuration.Fields.Update
    objEmail.Send
    
    Set objEmail = Nothing