Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ____ ____ ____________
- # / __ \/ __ \/_ __/ ____/
- # / /_/ / /_/ / / / / / __
- # / ____/ _, _/ / / / /_/ /
- #/_/ /_/ |_| /_/ \____/
- # NETWORK MONITOR
- #-------------------
- #(c) 2016 Stephan Linke, Paessler AG
- #
- #This script checks if a certain dynamic process is running on a remote machine.
- #
- # Parameter "-computername" for the remote hosts address and "-proc" for the dynamic process name
- param(
- $computername = "localhost",
- $proc = "proc"
- )
- # Get processes of the remote machine that are like the provided dynamic process name
- $Processes = (Get-WmiObject -ComputerName $computername -Query "SELECT * FROM Win32_Process WHERE NAME LIKE '%$($proc)%'")
- # Check if the process is found or not, report it back to PRTG.
- if([string]::IsNullOrEmpty($Processes)) {
- Write-Host ([string]::Format("{0}:{0} Process not found {1}.",0,$proc));
- } else {
- Write-Host ([string]::Format("{0}:{0} Process found {1}.",1,$proc));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement