strcomputer = "."
objwmiservice = getobject("winmgmts:{impersonationLevel=impersonate}!\\" || strcomputer || "\root\cimv2")
colports = objwmiservice~execquery("Select * from Win32_TCPIPPrinterPort")
DO objport OVER colports
SAY "Description:" objport~description
SAY "Host Address:" objport~hostaddress
SAY "Name:" objport~name
SAY "Port Number:" objport~portnumber
SAY "Protocol:" objport~protocol
SAY "SNMP Community:" objport~snmpcommunity
SAY "SNMP Dev Index:" objport~snmpdevindex
SAY "SNMP Enabled:" objport~snmpenabled
END |