ActiveXperts Network Monitor

Quicklinks


NOTE: ActiveXperts Network Monitor ships with a large collection of PowerShell scripts to monitor any aspect of your network. Most PowerShell scripts also have a VBScript implementation. Download Now »


Process check

You can use any of the Powershell programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.


Example

#################################################################################
# ActiveXperts Network Monitor PowerShell script, © ActiveXperts Software B.V.
# For more information about ActiveXperts Network Monitor, visit the ActiveXperts 
# Network Monitor web site at http://www.activexperts.com
#################################################################################
# Script:
#     Process.ps1
# Description:
#     Checks if a process, specified by strProcess, is running on the machine specified by strComputer. 
# Parameters:
#     1) strComputer As String - Hostname or IP address of the computer you want to check
#     2) strCredentials As String - Specify an empty string to use Network Monitor service credentials.
#         To use alternate credentials, enter a server that is defined in Server Credentials table.
#         (To define Server Credentials, choose Tools->Options->Server Credentials)
#     3) strProcess As String - Name of the process
# Usage:
#     CheckProcess "" "" ""
# Sample:
#     CheckProcess "localhost" "" "explorer.exe"
#################################################################################

param
(
[string]$strProcess
)

cls

$succ = "SUCCESS: The process (" + $strProcess+ ") was found  DATA: 1"
$err = "ERROR: The process (" + $strProcess+ ") is was not found  DATA: 0"

if( ([string]$strProcess -eq "") )
{
  echo "UNCERTAIN: Invalid number of parameters - Usage: .\Process.ps1  "
  exit
}

$found = "false";
Get-Process | ForEach-Object { if($_.ProcessName -eq $strProcess) { $found = "true"} }

if($found -eq "false")
{
  $err
  exit
}

$servicePrior = Get-Process $strProcess
if($servicePrior.WorkingSet -gt 20000)
{
  echo $succ
  exit
}
else
{
  echo $err
}