Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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()
Add Comment
Please, Sign In to add comment