-
-
Save johndonnelly/f5b04dc65daf73c5f734c01f368bd325 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an Internet Explorer object | |
$ie = New-Object -ComObject 'internetExplorer.Application' | |
$ie.Visible= $true # Make it visible | |
# Open all websites | |
$ie.Navigate("www.linkedin.com") | |
# Navigate2() function to open in new tab in the same IE window | |
$ie.Navigate2("www.facebook.com",0x1000) | |
$ie.Navigate2("www.gmail.com",0x1000) | |
$ie.Navigate2("login.live.com/",0x1000) | |
# Script to wait till webpage is downloaded into the browsers. | |
while ($ie.Busy -eq $true){Start-Sleep -seconds 4;} | |
# Feed in your credentials to the input fields on the web page | |
$usernamefield = $ie.Document.getElementByID('session_key-Login') | |
$usernamefield.value = 'YouEmailAddress@gmail.com' | |
$passwordfield = $ie.Document.getElementByID('Session_password-login') | |
$passwordfield.value = 'YouP@ssword' | |
$link=$ie.Document.getElementByID('signin') | |
$link.click() | |
# Facebook Login | |
# To Identify the Facebook window among the existing IE tabs. | |
$ie = (New-Object -COM "Shell.Application").Windows() | | |
?{$_.locationname -like '*facebook*'} | |
If($ie.Document -eq $null){ $ie.Refresh()} | |
while ($ie.Busy -eq $true){Start-Sleep -seconds 1} | |
# Feed in your credentials to input fields on the web page | |
$usernamefield = $ie.Document.getElementByID('email') | |
$usernamefield.value = 'YouEmailAddress@gmail.com' | |
$passwordfield = $ie.Document.getElementByID('pass') | |
$passwordfield.value = 'YouP@ssword' | |
$Link=$ie.Document.getElementByID("u_0_n") | |
$Link.click() | |
# Gmail Login | |
# To Identify the Gmail window among the existing IE tabs. | |
$ie = (New-Object -COM "Shell.Application").Windows() | ?{$_.locationname -like '*gmail*'} | |
If($ie.Document -eq $null){ $ie.Refresh()} | |
while ($ie.Busy -eq $true){Start-Sleep -seconds 1; echo 'loading gmail tab...'} | |
# Feed in your credentials to input fields on the web page | |
$usernamefield = $ie.Document.getElementByID('email') | |
$usernamefield.value = 'YouEmailAddress@gmail.com' | |
$passwordfield = $ie.Document.getElementByID('passwd') | |
$passwordfield.value = 'YouP@ssword' | |
$Link=$ie.Document.getElementByID('signin') | |
$Link.click() | |
# Microsoft Live Log In | |
# To Identify the Microsoft Live window among the existing IE tabs. | |
$ie = (New-Object -COM "Shell.Application").Windows() | ?{$_.locationname -like '*microsoft*'} | |
If($ie.Document -eq $null){ $ie.Refresh()} | |
while ($ie.Busy -eq $true){Start-Sleep -seconds 1; echo 'loading Live.com '} | |
# Feed in your credentials to input fields on the web page | |
$usernamefield = $ie.Document.getElementByID('i0116') | |
$usernamefield.value = 'YouEmailAddress@gmail.com' | |
$passwordfield = $ie.Document.getElementByID('i0118') | |
$passwordfield.value = 'YouP@ssword' | |
$Link=$ie.Document.getElementByID('idSIButton9') | |
$Link.click() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment