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 »


EventLog 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
#      EventLog.ps1
# Description:
#     Checks if an event is present into the EventLog
# Parameters:
#     1) strLogName (string)  - Log Name
#     2) strSource (string) - Name of the event
# Usage:
#      .\EventLog.ps1 "" "" 
# Sample:
#      .\EventLog.ps1 "application" "AxsNmSvc"
#################################################################################

# Parameters
param
  (
    [string]$strLogName,
    [string]$strSource
  )

cls

# Check paramters input
if( ([string]$strLogName -eq "") -or ([string]$strSource -eq "") )
  {
    echo "UNCERTAIN: Invalid number of parameters - Usage: .\EventLog.ps1  "
    exit
  }


#################################################################################
# THE SCRIPT ITSELF
#################################################################################

Get-Eventlog $strLogName | ForEach-object {
  if($_.Source -eq $strSource)
    {
      $succ = "SUCCESS: The Event (" + $strSource + ") was found into (" + $strLogName+")  DATA: 1"
    	echo $succ
    	exit
    }
}

$err = "ERROR: The Event (" + $strSource + ") was not found into (" + $strLogName+")  DATA: 0"
echo $err