' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) ' (c) 2015 Borja Sanchez ' This plugin extends agent inventory feature. Only enterprise version ' -------------------------------------------------------------------------- On Error Resume Next 'WMI printers attached Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "Printers" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" function validPort(port) if strComp(port,"SHRFAX:") = 0 then validPort = false elseif strComp(port,"nul:") = 0 then validPort = false elseif strComp(port,"PORTPROMPT:") = 0 then validPort = false elseif strComp(port,"XPSPort:") = 0 then validPort = false elseif strComp(port,"PDF:") = 0 then validPort = false else validPort = true end if end function Set oWMI = GetObject("winmgmts:\\" & "." & "\root\cimv2") Set colPrinters = oWMI.ExecQuery("Select * from Win32_Printer",,48) For Each objPrinter in colPrinters if validPort (objPrinter.PortName) then set tcp_port_exists = 0 WScript.stdOut.Write "" end if Next Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine ""