![]() + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft. + CategoryInfo : NotSpecified: (:), UnauthorizedA WMI enables you to run processes remotely, schedule tasks that have to start at particular times, reboot computers remotely, read event logs, and find out which applications are installed on local and remote computers. + $Processes = (Get-WmiObject -ComputerName $computername -Query "SELECT * WMI is a management technology that can be used for much more than reading system information. In C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\Dynamic So far the script works perfectly when used in a sensor on a local probe but it gives back no results nor error when used on a remote machine so I guessed it's an authentication problem.Ĭhecking the logs in fact I see Access denied Get-WmiObject : Accesso negato. ",$Processes,$proc) the last Format to have the result of processes count included in the output # Check if the process is found or not, report it back to PRTG. $Processes = (Get-WmiObject -ComputerName $computername -Query "SELECT * FROM Win32_Process WHERE NAME LIKE '%$($proc)%'") # Get processes of the remote machine that are like the provided dynamic process name If this is the first time a new environment is created for you. # Parameter "-computername" for the remote hosts address and "-proc" for the dynamic process name On the remote computer: log in using your normal account. #This script checks if a certain dynamic process is running on a remote machine. ps1 file in this subfolder of the PRTG program directory on the probe system from where you want to check the process: \Custom Sensors\EXE\ # _ _ _ The script can look for a process that is named like "FTPServer" and will find the process "FTPServer" also with changing numbers. For example, consider the process "FTPServer100.exe" that increases the number at the end every day.The script looks for a process that is like the given process name.The script basically checks if the desired process runs on the remote host or not.To monitor a dynamic Windows process, use the following PowerShell (.ps1) script. This article applies to PRTG Network Monitor 16 or later How to Monitor a Dynamic Windows Process
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |