Advertisement
Guest User

xmodiify

a guest
Oct 25th, 2017
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <# Created: January 18, 2014 Version: 2.0 Description: On login, launch Internet Explorer to a specified URL, and then open an executable file. Notes: If the workstation is running Windows 7, login as the user, open "GPEDIT.MSC", and navigate to the following location.
  2. User Configuration\Windows Settings\Scripts (Logon/Logoff)
  3. Next, open "Logon" and go to the "PowerShell Scripts" tab. Then, add this script to it. However, first modify
  4. the following variables. You can edit it in a text editor or in the PowerShell ISE.
  5. $Url $Username $Password $Executable
  6. IMPORTANT: Before running the script, open the web browser and go to the web site that will be specified in this
  7. script and right click in the username field and select Inspect Element. Locate the "Input Name" and then copy and
  8. paste it in place of "UsernameElement" located at the end of this script (line 61). Then, inspect the password field,
  9. and copy and paste the "Input Name" in place of "PasswordElement" located at the end of this script (line 62). Then,
  10. right click on the submit button on the URL and locate the Input Name and then copy paste it in place of "SubmitElement" at the end of this script (line 63).
  11. >
  12.  
  13. Edit this to be the URL or IP address of the site to launch on login
  14.  
  15. $Url = “www.microsoft.com”
  16. Edit this to be the username
  17.  
  18. $Username=”name@microsoft.com”
  19. Edit this to the corresponding password
  20.  
  21. $Password=”password”
  22. Edit this to be the path to the executable. Include the executable file name as well.
  23.  
  24. $Executable = "c:\windows\system32\notepad.exe"
  25. Invoke Internet Explorer
  26.  
  27. $IE = New-Object -com internetexplorer.application; $IE.visible = $true; $IE.navigate($url);
  28. Wait a few seconds and then launch the executable.
  29.  
  30. while ($IE.Busy -eq $true)
  31. {
  32. Start-Sleep -Milliseconds 2000;
  33. }
  34. The following UsernameElement, PasswordElement, and LoginElement need to be modified first. See the notes at the top
  35.  
  36. of the script for more details.
  37.  
  38. $IE.Document.getElementById(“UsernameElement”).value = $Username $IE.Document.getElementByID(“PasswordElement”).value=$Password $IE.Document.getElementById(“SubmitElement”).Click()
  39. while ($IE.Busy -eq $true)
  40. {
  41. Start-Sleep -Milliseconds 2000;
  42. }
  43. Invoke-Item $Executable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement