Jannos-443
Monitors pending PrintJobs and PrintJobs Age Sensor message shows PrinterQueue and Job Owner.
-
Place
PRTG-PrintJobs.ps1
underC:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML
-
Create new Sensor
Settings Value EXE/Script Advanced PRTG-PrintJobs.ps1 Parameters -ComputerName %host Security Context Use Windows credentials of parent device" or use "-Username" and "-Password" -
Set the "$IncludeName", "$ExcludeName", "IncludeUser" or "ExcludeUser" parameter to Exclude PrinterQueues
-Computername "%host" -ExcludeName '^(TestPrinter.*)$'
Excludes all PrintJobs from printers beginning with TestPrinter
-Computername "%host" -IncludeName '^(TestPrinter.*)$'
Only includes PrintJobs from printers beginning with TestPrinter
-Computername "%host" -ExcludeUser '^(TestUser)$'
Excludes all PrintJobs from the user TestUser
-Computername "%host" -Username "%linuxUser" -Password "%linuxpassword"
use Username and Password instead of "Windows Credentials" (not recommended)
If you connect to Computers by IP or to not Domain Clients please read Microsoft Docs
you maybe have to add the target to the TrustedHosts on the PRTG Probe and use explicit credentials.
example (replace all currenty entries):
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value "ServerIP1,ServerIP2,ServerHostname1"
example want to and and not replace the list:
$curValue = (Get-Item wsman:\localhost\Client\TrustedHosts).value
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "$curValue,NewServer3.test.com"
exmaple PRTG parameter with explicit credentials:
-ComputerName "%host" -Username "%windowsuser" -Password "%windowspassword"
You can use the variables to exclude/include PrintJobs The variables take a regular expression as input to provide maximum flexibility.
For more information about regular expressions in PowerShell, visit Microsoft Docs.
".+" is one or more charakters ".*" is zero or more charakters