I wrote a simple script to check to see if the PRTG console is installed on one of the desktop Windows PC's I am monitoring:
$installed = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName | Select-String -Pattern "PRTG" | Get-Unique | Measure-Object -line write-host $installed.Lines
I tested this on one of the target machines and got the integer 1 back, as expected. However, the script appears to be getting the result off the core server, not the machine the sensor is under. I tried changing the program in Select-String to check for a program that is only on the core server, and sure enough it reported that correctly.
I want to check the target computer for the installed programs, so I'm not sure what I'm doing wrong
Add comment