Invoke-Webrequest does not login to page

Welcome Forums General PowerShell Q&A Invoke-Webrequest does not login to page

Viewing 1 reply thread
  • Author
    Posts
    • #275256
      Participant
      Topics: 1
      Replies: 1
      Points: 15
      Rank: Member

      Hi All,

      i am trying to log on to a website using POST, but unfortunatly i keep getting the login page as result.
      i noticed that the $web.Forms[0].Action is empety so i entered the full Uri in the webrequest.
      what am i doing wrong here ?

       

      $web = Invoke-WebRequest -Uri  ‘https://vslangedijk.redlumy.nl/Identity/Account/Login’ -SessionVariable session

      $web.Forms[0].Fields.’Input_Email’ = $U
      $web.Forms[0].Fields.’Input_Password’ = $P

      $web2 = Invoke-WebRequest -Uri ‘https://vslangedijk.redlumy.nl/Identity/Account/Login’ -WebSession $session -Method POST -Body $web.Forms[0].Fields

       

    • #275259
      Participant
      Topics: 1
      Replies: 1
      Points: 15
      Rank: Member

      somehow the forum added #8217;  to my links instead of showing a ‘

Viewing 1 reply thread
  • You must be logged in to reply to this topic.