Guest User

Untitled

a guest
Feb 18th, 2018
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. # Create an Internet Explorer object
  2. $ie = New-Object -ComObject 'internetExplorer.Application'
  3. $ie.Visible= $true # Make it visible
  4.  
  5. # Open all websites
  6. $ie.Navigate("www.linkedin.com")
  7.  
  8. # Navigate2() function to open in new tab in the same IE window
  9.  
  10. $ie.Navigate2("www.facebook.com",0x1000)
  11. $ie.Navigate2("www.gmail.com",0x1000)
  12. $ie.Navigate2("login.live.com/",0x1000)
  13.  
  14. # Script to wait till webpage is downloaded into the browsers.
  15. while ($ie.Busy -eq $true){Start-Sleep -seconds 4;}
  16.  
  17. # Feed in your credentials to the input fields on the web page
  18. $usernamefield = $ie.Document.getElementByID('session_key-Login')
  19. $usernamefield.value = 'YouEmailAddress@gmail.com'
  20. $passwordfield = $ie.Document.getElementByID('Session_password-login')
  21. $passwordfield.value = 'YouP@ssword'
  22. $link=$ie.Document.getElementByID('signin')
  23. $link.click()
  24.  
  25. # Facebook Login
  26. # To Identify the Facebook window among the existing IE tabs.
  27. $ie = (New-Object -COM "Shell.Application").Windows() |
  28. ?{$_.locationname -like '*facebook*'}
  29. If($ie.Document -eq $null){ $ie.Refresh()}
  30. while ($ie.Busy -eq $true){Start-Sleep -seconds 1}
  31.  
  32. # Feed in your credentials to input fields on the web page
  33. $usernamefield = $ie.Document.getElementByID('email')
  34. $usernamefield.value = 'YouEmailAddress@gmail.com'
  35. $passwordfield = $ie.Document.getElementByID('pass')
  36. $passwordfield.value = 'YouP@ssword'
  37. $Link=$ie.Document.getElementByID("u_0_n")
  38. $Link.click()
  39.  
  40. # Gmail Login
  41. # To Identify the Gmail window among the existing IE tabs.
  42. $ie = (New-Object -COM "Shell.Application").Windows() | ?{$_.locationname -like '*gmail*'}
  43. If($ie.Document -eq $null){ $ie.Refresh()}
  44. while ($ie.Busy -eq $true){Start-Sleep -seconds 1; echo 'loading gmail tab...'}
  45.  
  46. # Feed in your credentials to input fields on the web page
  47. $usernamefield = $ie.Document.getElementByID('email')
  48. $usernamefield.value = 'YouEmailAddress@gmail.com'
  49. $passwordfield = $ie.Document.getElementByID('passwd')
  50. $passwordfield.value = 'YouP@ssword'
  51. $Link=$ie.Document.getElementByID('signin')
  52. $Link.click()
  53.  
  54. # Microsoft Live Log In
  55. # To Identify the Microsoft Live window among the existing IE tabs.
  56. $ie = (New-Object -COM "Shell.Application").Windows() | ?{$_.locationname -like '*microsoft*'}
  57. If($ie.Document -eq $null){ $ie.Refresh()}
  58. while ($ie.Busy -eq $true){Start-Sleep -seconds 1; echo 'loading Live.com '}
  59.  
  60. # Feed in your credentials to input fields on the web page
  61. $usernamefield = $ie.Document.getElementByID('i0116')
  62. $usernamefield.value = 'YouEmailAddress@gmail.com'
  63. $passwordfield = $ie.Document.getElementByID('i0118')
  64. $passwordfield.value = 'YouP@ssword'
  65. $Link=$ie.Document.getElementByID('idSIButton9')
  66. $Link.click()
Add Comment
Please, Sign In to add comment