logon router

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Jeffrey Roossien Jeffrey Roossien 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37028
    Profile photo of Jeffrey Roossien
    Jeffrey Roossien
    Participant

    hello, i need a script that resets my portforward everytime i restart my pc (i dont know why but everytime my pc restarts the portforward resets)
    this is my logon script

    $username = "ziggo"
    $password = "draadloos"
    $router = "192.168.178.1"
    $ie = New-Object -com InternetExplorer.Application
    $ie.visible=$true
    $ie.Navigate($router)
    while($ie.ReadyState -ne 4) {start-sleep -m 100}
    start-sleep -s 3

    $ie.Document.getElementsByName('loginUsername').value = '$username'

    $ie.Document.getElementsByName('Password').value = '$password'

    $ie.Document.getElementsByName('submit').click()

    i changed getElementsByName part to nearly everything i can come up with, no succes

    logon site html: https://www.dropbox.com/s/zlak6auqbdey5lb/view-source_192.168.178.1.html?dl=0

    #37031
    Profile photo of Don Jones
    Don Jones
    Keymaster

    You're using single quotation marks. That means $username and $password will be passed as literals. If you use double quotes, the variables will be replaced with their contents.

    #37056
    Profile photo of Jeffrey Roossien
    Jeffrey Roossien
    Participant

    didnt really matter since it didnt even fill it in, but thanks anyways.
    heres a screenshot of powershell (too lazy to cut out rest, sorry)
    https://www.dropbox.com/s/m5fjhyhx8pg3ext/screenshot.png?dl=0
    and yes i edited 'loginusername' with double quotes, still no success

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.