Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Open a web browser and pass logon credentials

$
0
0

Hi,

I am trying to write a script to open a browser and login to a page that uses a username and password field .  It's not runing in IIS and the username and password are just on the form so I am unsure how I would pass the credentials in.  It's not basic authentication either.

I have this so far

   $url = "https://testURL
 
  
    $webclient = new-object System.Net.WebClient
     $credCache = new-object System.Net.CredentialCache
    
     $creds = new-object System.Net.NetworkCredential("username","password", "domain")
     $credCache.Add($url, "Negotiate", $creds)
     $webclient.Credentials = $credCache
 


Alter De Ruine


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>