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("WbemScriptin
g.SWbemLoc
ator")
Set objWMIService = objSWbemLocator.ConnectSer
ver(strCom
puter, _
"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