unable to change printer port

Copper Contributor

Hi team, I am still working on updating printer driver ports . 

with my power script I was able to add a port, attach it to the printer driver. however, when I look at the ports list for the printer driver shows as not selected . in fact still showing old port selected. 

Add-PrinterPort -Name "ipaddress" -PrinterHostAddress "ipaddress" -ComputerName "pcname"
Get-Printer -ComputerName pcname
 | Where-Object {$_.PortName -eq "ipaddress"} | Set-Printer -PortName "ipaddress"
Remove-PrinterPort -Name "ipaddress"
1 Reply



$a=Get-Printer -ComputerName pcname| where-object {$_.portname -eq "oldip"}
set-printer -InputObject $a

I used the above script to set the port on the driver.