Advertisement
DGorka

Dynamic Process Monitor

Aug 3rd, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # ___ ___ _____ ___
  2. #| _ \ _ \_   _/ __|
  3. #|  _/   / | || (_ |
  4. #|_| |_|_\ |_| \___|
  5. #    NETWORK MONITOR
  6. #-------------------
  7. # Description: The script will check if a process is running, it will alert you if not (Using Placeholders!)
  8. # Parameters:
  9. # - processname: The processname to the last possible char (e.g. instead of explorer, use explor)
  10. # ------------------
  11. # (c) 2016 Dariusz Gorka | Paessler AG
  12.  
  13. param(
  14.     [string]$processname = "explor"
  15.     )
  16.  
  17. $process = &tasklist | Select-String -Pattern "$processname*"
  18.     if ($process)
  19.     { Write-Host ":Process "$processname" found!"; }
  20.     else
  21.     { Write-Host ":Process "$processname" could not found!"; exit 2 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement