Forum Discussion

mpd53210's avatar
mpd53210
Copper Contributor
Jun 05, 2020

unable to change printer port

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"
  • mpd53210's avatar
    mpd53210
    Copper Contributor

    mpd53210 

     

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

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

Resources