jeudi 9 novembre 2017

Checkbox not working in TCP/IP settings

I've been trying to get powershell to check boxes in the TCP/IP Settings on a printer, but not able to get it to work. It seems that the comes up different in these settings than the rest of it where the boxes do work.

input id="vac.255.ALLOW_DHCP_TO_UPDATE_TIMESERVER" name="vac.255.ALLOW_DHCP_TO_UPDATE_TIMESERVER" value="1" type="checkbox" is the info in TCP/IP.

input name="2.system.17245" value="1" id="system.17245" checked="" type="checkbox" is the info that is in the rest of the printer. Below is the code that works it checks and unchecks with no issues.

$adfbeep = $ie.Document.IHTMLDocument3_getElementByID("system.17245") | Where-Object {$_.type -eq "checkbox"} $adfbeep.checked=$true

Below is essentially the same, but doesn't work. Not sure if it is because the name and id are the same. $updttimeserver = $ie.Document.IHTMLDocument3_getElementByID("vac.255.ALLOW_DHCP_TO_UPDATE_TIMESERVER") | Where-Object {$_.type -eq "checkbox"} $updttimeserver.checked=$true

The property 'checked' cannot be found on this object. Verify that the property exists and can be set. At C:\Scripts\CX310 Config.ps1:132 char:1 + $updttimeserver.checked=$true + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : PropertyNotFound

Any help would be appreciated. Sorry if it seems a bit over the place




Aucun commentaire:

Enregistrer un commentaire