Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $username = "XXXX";
  2. $password = "XXX:)";
  3. $loginUrl = "https://example.com";
  4. $iterator = 1;
  5.  
  6. #initialize browser
  7. $ie = New-Object -com internetexplorer.application;
  8. $ie.visible = $true;
  9. $ie.navigate($loginUrl);
  10. while ($ie.Busy -eq $true) { Start-Sleep -Seconds 1; } #wait for browser idle
  11. ($ie.document.getElementsByName("username") |select -first 1).value = $username;
  12. ($ie.document.getElementsByName("password") |select -first 1).value = $password;
  13. ($ie.document.getElementsByName("login") |select -first 1).click();
  14. while ($ie.Busy -eq $true) { Start-Sleep -Seconds 1; } #wait for browser idle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement