Jun 08 2020 05:37 PM
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?
Jun 08 2020 05:44 PM
Jun 08 2020 07:16 PM - edited Jun 08 2020 07:19 PM
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.
Jun 28 2020 09:47 AM - edited Jun 28 2020 09:48 AM
What powershell version are you using?
get-host
Probably portname is not supported in your version
try
$a|gm
to see method an properties of yout object
Report the output here