Advertisement

12.19.2007 at 03:54PM PST, ID: 23034865
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Help writing a script incorporating a command line emailer app

Asked by birdn in Scripting Languages, Visual Basic Programming, VB Script

Tags: , ,

All:

I currently use the following script and it works perfect for what I need it to do -

=============================
strcomputer = inputbox("What Server?", "Srevername", "enter_server_name_here")
strprocess = inputbox("What process?", "Process Name", "enter_process.exe_here")
 
strUser = "domain\username"
strPassword = "respective_password"
 
 
'on error resume Next
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
    "root\CIMV2", strUser, strPassword, "MS_409", "NTLMDomain:" + strDomain)
Set colProcesses = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = '" & strprocess & "'")
If colProcesses.Count = 0 Then
    Wscript.Echo strprocess & " is not running."
Else
    Wscript.Echo strprocess & " is running."
End If
=============================

What I'd like is a script that, from a remote server, I can use Windows Task Scheduler to run the script every hour or so and if the process is not runnning a command line emailer called Postie runs notifying us via email that the process is no longer running.

The script would maintain most of the key information such as the server name, process, domain/username, password.

The Postie.exe file resides in the Windows directory.  From either the command prompt or the command line (Start>Run) I type something like this manually, to make it work: postie -host:mailserver.com -from:fred@here -to:joe@there -s:"Here it is..." -nomsg -a:file.zip.  Then an email is delivered to my mailbox.  But if its easier to run the Postie command in another script then so be it...I guess what I'm saying is if this needs to be a two-part script to make it work that's fine.

If it appears I'm over complicating things I'm open to any suggestions to make this work.  However, I'd prefer to stick with a script, since its free and we've got no budget for a third party application.

Thanks very much.
Donald.

Start Free Trial
[+][-]12.20.2007 at 12:11AM PST, ID: 20505339

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Scripting Languages, Visual Basic Programming, VB Script
Tags: Microsoft, VBScript, Running a script with a command line emailer app
Sign Up Now!
Solution Provided By: deadite
Participating Experts: 1
Solution Grade: A
 
 
[+][-]12.20.2007 at 10:30AM PST, ID: 20508796

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 03:15PM PST, ID: 20510686

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 04:34PM PST, ID: 20511017

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 10:34AM PST, ID: 20515453

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 01:18PM PST, ID: 20516415

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628