Forum Discussion
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 get "portname" property doesn't exist .
The property 'PortName' cannot be found on this object. Verify that the property exists and can be set.
any ideas?
- mpd53210Copper Contributorduring debugging I saw that cimproperty has the portname property. however I do not know how to read or update it.
- mpd53210Copper 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.