Create muliple IP based Printers
By nater

'Nslacum 11/30/06 Creates IP printers on local pc.

PrntDriver = "HP LaserJet 4"
Set objDictionary = CreateObject("Scripting.Dictionary")


'***************SET YOUR PRINTER NAME AND IP ADDRESS********************

objDictionary.Add "printer1", "10.10.10.10"
objDictionary.Add "printer2", "10.10.10.11"

'***********************************************************************

'******* Create IP ports for each printer that will be created*********

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate,(LoadDriver)}!\\" & strComputer & "\root\cimv2")

Set objNewPort = objWMIService.Get ("Win32_TCPIPPrinterPort").SpawnInstance_

colItems = objDictionary.Items
For Each strItem In colItems

objNewPort.Name = "IP_" & strItem
objNewPort.Protocol = 1
objNewPort.HostAddress = strItem
objNewPort.PortNumber = "9999"
objNewPort.SNMPEnabled = False
objNewPort.Put_


Next
'***********************************************************************


'************************Create Printers*********************************

strComputer = "."

Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_

For Each obj In objDictionary

objPrinter.DriverName = PrntDriver
objPrinter.PortName = "IP_" & objDictionary(obj)
objPrinter.DeviceID = obj
'objPrinter.Location = "you can unrem this if you want to add description"
'objPrinter.Network = True
'objPrinter.Shared = False
'objPrinter.ShareName = "ScriptedPrinter"
objPrinter.put_

Next

Wscript.echo "The Printers should now be set up"
'************************************************************************

Rating:


4/5 based on 1 vote. The median rating is 4.

Submitted: 11/19/10 (Edited 11/19/10)

Description: This script will create printers with your specified print driver as well as an ip address assigned to it. Simple modify the dictionary object as well as the driver name. Note: the driver name needs to be the exact name found in windows.

Tags:

Views: 39 views. Averaging 0 views per day.
In the most recent 30 day period, there've been 0 views.

Similar Articles:
AT&T: Exclusivity Helped Create Android - And
AT&T, Former FTC Boss Create Privacy Lobbying
AT&T, Former FTC Boss Create Privacy Lobbying
AT&T: Acquiring DirecTV Will Create a Broadban
AT&T: Exclusivity Helped Create Android - And

Previous Article