Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Monitor is a process is running

Reply
 
Old 01-22-2009   #1 (permalink)
Matt Anderson


 
 

Monitor is a process is running

Does anyone have a link to a script that will check to see if a process I
define is running on a remote machine?

Thanks,
Matt

My System SpecsSystem Spec
Old 01-22-2009   #2 (permalink)
PaulChavez


 
 

RE: Monitor is a process is running

$server = "localhost"
$process = "lsass.exe"
Get-WMIObject Win32_Process -computer $server -filter "Name = '$process'"

Then just check the

"Matt Anderson" wrote:
Quote:

> Does anyone have a link to a script that will check to see if a process I
> define is running on a remote machine?
>
> Thanks,
> Matt
My System SpecsSystem Spec
Old 01-22-2009   #3 (permalink)
Matt Anderson


 
 

RE: Monitor is a process is running

Here is my solution. Thanks all.

strComputer = "Aurora"
strtixpsc = "fail"
stractivecharge = "fail"

Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_Process")

For Each wbemObject In wbemObjectSet
If wbemObject.Name = "Active-Charge.Exe" Then
stractivecharge = "success"
End If
Next
If stractivecharge = "fail" Then
SMTPServer = "email@xxxxxx"
Recipient = "email@xxxxxx"
From = "email@xxxxxx"
Subject = "Box Office Processes Down!!!"
Message = "activecharge.exe has failed"
set msg = WScript.CreateObject("CDO.Message")
msg.From = From
msg.To = Recipient
msg.Subject = Subject
msg.TextBody = Message
msg.Configuration.Fields
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer

msg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msg.Configuration.Fields.Update
msg.Send
End If

For Each wbemObject In wbemObjectSet
If wbemObject.Name = "TIX_PSC.exe" Then
strtixpsc = "success"
End If
Next
If strtixpsc = "fail" Then
SMTPServer = "email@xxxxxx"
Recipient = "email@xxxxxx"
From = "email@xxxxxx"
Subject = "Box Office Processes Down!!!"
Message = "tix_psc.exe has failed"
set msg = WScript.CreateObject("CDO.Message")
msg.From = From
msg.To = Recipient
msg.Subject = Subject
msg.TextBody = Message
msg.Configuration.Fields
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer

msg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msg.Configuration.Fields.Update
msg.Send
End If


"PaulChavez" wrote:
Quote:

> $server = "localhost"
> $process = "lsass.exe"
> Get-WMIObject Win32_Process -computer $server -filter "Name = '$process'"
>
> Then just check the
>
> "Matt Anderson" wrote:
>
Quote:

> > Does anyone have a link to a script that will check to see if a process I
> > define is running on a remote machine?
> >
> > Thanks,
> > Matt
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
process monitor and autoruns new versions Software
iexplore running as process Vista General
Process Monitor 2 Released - Now with more cowbell! Vista News
How can I get information about running process? PowerShell
Process Running Elevated? Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46