Forum Discussion
mpd53210
Jun 09, 2020Copper Contributor
how to change printer port address on windows 7
Hi, I hope you and your family are safe. B.L.M. I am running ps script to change remote pc printer driver port address. this works fine for windows 10. However if the target pc is windows 7 i ...
mpd53210
Jun 09, 2020Copper Contributor
Hello again. I have the following script. Every time I run it shows me an error.
$a=Get-Printer -ComputerName $pcname1 | Where-Object {$_.
PortName -like $OldIP}
$a.PortName = $NewIP
Set-Printer -InputObject $a
I get this error
The property 'PortName' cannot be found on this object. Verify that the property exists and can be set
the error is on line for ($a.PortName = $NewIP)
during debug, when I hover on $a I can see properties of $a and it has two printers showing. when I drill down into it, I can see portname has the IP address that I need to change.