Printer port/ip addresses

Hi All ,

I have been googling different keywords to find a program or script that wil be able to give me the port name and IP address from a print server with over 400 print queues.
Doing it manually would be very tedious.
Any ideas, programs, scripts will help.

Thanks.

Re: Printer port/ip addresses

Is that a printer with 400 print queues or a print server with 400 items in its queue?

If printer, you can check the IP of the printer on the printer and then you have to worry about the script to find port on the computers which have direct local print queues.

if its print server, you should know its IP, and then in the printer properties, ports tab would show you the IP of the printer port.

Re: Printer port/ip addresses

This is a server with 400 print queues ( 400 different printers) which have their own portname with distinct IPs.

Re: Printer port/ip addresses

Fayyaz, there is a tool called Scriptomatic..available from microsoft. You can find it here http://www.microsoft.com/downloads/details.aspx?FamilyID=09dfc342-648b-4119-b7eb-783b0f7d1178&DisplayLang=en
Once you download and unzip the file, run the scripromaticv2.hta.
Select WMI Source and put in the fqdn name of the server that has the print queues. Then scrool down on the WMI Class drop down list and find **“Win32_TCPIPPrinterPort”. **In the target computers put the name of the server and hit update script. Then select Run… Viola…you have all the printers. Here is the script it produces.

On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array(“SPRB4STQ51”)
For Each strComputer In arrComputers
WScript.Echo
WScript.Echo “==========================================”
WScript.Echo "Computer: " & strComputer
WScript.Echo “==========================================”
Set objWMIService = GetObject(“winmgmts:\” & strComputer & “\root\CIMV2”)
Set colItems = objWMIService.ExecQuery(“SELECT * FROM Win32_TCPIPPrinterPort”, “WQL”, _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "ByteCount: " & objItem.ByteCount
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "CreationClassName: " & objItem.CreationClassName
WScript.Echo "Description: " & objItem.Description
WScript.Echo "HostAddress: " & objItem.HostAddress
WScript.Echo "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
WScript.Echo "Name: " & objItem.Name
WScript.Echo "PortNumber: " & objItem.PortNumber
WScript.Echo "Protocol: " & objItem.Protocol
WScript.Echo "Queue: " & objItem.Queue
WScript.Echo "SNMPCommunity: " & objItem.SNMPCommunity
WScript.Echo "SNMPDevIndex: " & objItem.SNMPDevIndex
WScript.Echo "SNMPEnabled: " & objItem.SNMPEnabled
WScript.Echo "Status: " & objItem.Status
WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
WScript.Echo "SystemName: " & objItem.SystemName
WScript.Echo "Type: " & objItem.Type
WScript.Echo
Next
Next

Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & “/” & _
Mid(dtmDate, 7, 2) & “/” & Left(dtmDate, 4) _
& " " & Mid (dtmDate, 9, 2) & “:” & Mid(dtmDate, 11, 2) & “:” & Mid(dtmDate,13, 2))
End Function

Re: Printer port/ip addresses

Actually I have used scriptomatic before. I will try it for this. Thanks.