MoleDirect
Technical User
We are undergoing a complete IP change, and we have many users mapped to many different printers..
I am trying to make a script that looks for TCP/IP ports printers are attached to, and replace them with another IP based on an external file... Here is the logic I am working with:
Use with CSV containing 2 fields, OLDIP and NEWIP
___
Script Logical Actions:
enumerate printers
for each printer..
Get ports
if port = any IP in field OLDIP
replace port with ip in field NEWIP
Next
The problem is, all I have is the script to place a new port... Here is the example for that :
If anyone has done this before, ir has any good resources, your help would be greatly appreciated!
I am trying to make a script that looks for TCP/IP ports printers are attached to, and replace them with another IP based on an external file... Here is the logic I am working with:
Use with CSV containing 2 fields, OLDIP and NEWIP
___
Script Logical Actions:
enumerate printers
for each printer..
Get ports
if port = any IP in field OLDIP
replace port with ip in field NEWIP
Next
The problem is, all I have is the script to place a new port... Here is the example for that :
Code:
Set objWMIService = GetObject("winmgmts:")
Set objNewPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_169.254.110.14"
objNewPort.Protocol = 1
objNewPort.HostAddress = "169.254.110.14"
objNewPort.PortNumber = "9999"
objNewPort.SNMPEnabled = False
objNewPort.Put_
If anyone has done this before, ir has any good resources, your help would be greatly appreciated!