Jump to content

change (replace) print tcp ip port


usera
 Share

Recommended Posts

Greeting,

I have an environment, users installed tcp/ip port printers in their workstation, printing are working. right now the printer's IP Address changed from

172.1.1.0 network to 10.10.10.0 network.

How can I change the settings in the user's workstation? (again, the only change is the TCP/IP Port. printer driver did not change). To change the port form 172.1.1.x to 10.10.10.x and keep all the existing settings, then delete the 172.1.1.x port as well.

Thanks

usera

Link to comment
Share on other sites

What OS are the client machines running. If Vista/Windows 7 you can use built-in prncnfg.vbs to change the ports

If XP look

EDIT: Windows 7/Vista Example:

$Server = '\\YourServer'
$IP = 'YourIPToAdd'
$PrinterName = 'ActualPrinterNameFromDevicesAndPrinters'

$AddPortCommand = @Comspec & ' /c cscript "' & @WindowsDir & '\System32\Printing_Admin_Scripts\en-US\prnport.vbs" -a -s ' & $Server & ' -r IP' & Chr(95) & $IP & ' -h ' & $IP
;Add New Printer Port (if needed)
RunWait($AddPortCommand)


$ChangePortCommand = @Comspec & ' /c cscript "' & @WindowsDir & '\System32\Printing_Admin_Scripts\en-US\prncnfg.vbs" -t -p "' & $PrinterName & '" -r IP' & Chr(95) & $IP
;Assign new Port to printer
RunWait($ChangePortCommand)

ClipPut($AddPortCommand & @LF & $ChangePortCommand) ;just so you can see what commands were sent
Edited by Varian
Link to comment
Share on other sites

What OS are the client machines running. If Vista/Windows 7 you can use built-in prncnfg.vbs to change the ports

If XP look

EDIT: Windows 7/Vista Example:

$Server = '\\YourServer'
$IP = 'YourIPToAdd'
$PrinterName = 'ActualPrinterNameFromDevicesAndPrinters'

$AddPortCommand = @Comspec & ' /c cscript "' & @WindowsDir & '\System32\Printing_Admin_Scripts\en-US\prnport.vbs" -a -s ' & $Server & ' -r IP' & Chr(95) & $IP & ' -h ' & $IP
;Add New Printer Port (if needed)
RunWait($AddPortCommand)


$ChangePortCommand = @Comspec & ' /c cscript "' & @WindowsDir & '\System32\Printing_Admin_Scripts\en-US\prncnfg.vbs" -t -p "' & $PrinterName & '" -r IP' & Chr(95) & $IP
;Assign new Port to printer
RunWait($ChangePortCommand)

ClipPut($AddPortCommand & @LF & $ChangePortCommand) ;just so you can see what commands were sent

Varian,

Thank you very very much.

I think the issue is. I only have 2 pieces of information, old IP for the printer and the new IP, If I found the old IP then change it to the New IP.

The whole processes like add a new TCP/IP Port then link to the existing printer drive. then delete the older Port.

Usera

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...