Need Help with Code for Auto Logon to a Website

Welcome Forums General PowerShell Q&A Need Help with Code for Auto Logon to a Website

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 8 months ago.

  • Author
  • #5670

    Topics: 1562
    Replies: 0
    Points: 0
    Rank: Member

    by Shellshocked at 2013-03-15 11:12:08


    I'm new to Powershell and was wanting to get some help with a script. I was trying to create a script to auto logon to a website. Currently my script will open the web page but after that nothing happens. I was hoping some one could review my script and the source of the web page and help with where i'm going wrong. I will post the script and the source page below.


    $username = "name"
    $password = "password"

    $ie = New-Object -comobject InternetExplorer.Application
    $ie.visible = $true
    $ie.silent = $true
    $ie.Navigate( "http://site&quot😉
    while($ie.ReadyState -ne 4){Start-Sleep -m 100}
    $ie.Document.getElementById("webUsername").value = "$username"
    $ie.Document.getElementById("webPassword").value = "$password"



    User ID


    by DonJ at 2013-03-16 09:08:11

    You're using GetElementByID but the submit button doesn't have an ID. Its type attribute does not constitute an ID attribute. In fact, none of the input elements have an ID – a "name" is also not "id."

The topic ‘Need Help with Code for Auto Logon to a Website’ is closed to new replies.