Jan 17


If you need to add alot of TCP/IP Printer Ports to a Windows 2003 server you might want to use a script to make adding printer ports faster. The Windows 2003 Server Resource Kit has a dll called prnadmin.dll that when registered will allow you to script many operations related to print services like adding printer ports. Here is how to install and use prnadmin.dll to Script TCP/IP Printer Port creation.
First install the Windows 2003 Resource kit on the server. You can get the Windows 2003 Resource Kit at Microsoft.
Next register the prnadmin.dll using regsvr32. To do that drop into DOS. Then navigate into the folder where prinadmin.dll is located “The Tools Folder” and type regsvr32 prnadmin.dll and you should get a message that it succeed.
Now create a script to add your printer and edit the ip addresses in the script. Then save it as a *.vbs file and run it by typing it’s name in DOS or double clicking the file. Then edit the file again for your next port and save and re run.

Copy and paste the script below into a text file. Name it something.vbs and then just change the ip address to match what you need.

dim oPort
dim oMaster
set oPort = CreateObject(“Port.Port.1″)
set oMaster = CreateObject(“PrintMaster.PrintMaster.1″)
oPort.ServerName = “\\servername”

oPort.PortName = “IP_192.168.47.53″

oPort.PortType = 1

oPort.HostAddress = “192.168.47.53″

oPort.PortNumber = 9100

oPort.SNMP = true

oPort.SNMPDeviceIndex = 1

oPort.CommunityName = “public”

oPort.QueueName = “Queue”

oPort.DoubleSpool = true

oMaster.PortAdd oPort

If Err <> 0 then

end if