Guest User

Launch Work Apps

a guest
Jun 6th, 2024
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #
  2. # Script to launch the apps I use for work without entering my credentials
  3. # over and over again. It would be nice to be able to have the apps launch
  4. # in a virtual desktop (I have 3), but that is not supported AFAIK
  5. #
  6.  
  7. # Get Admin creds and store them
  8. $credentials = Get-Credential -Message "Please enter DT Credentials: "
  9.  
  10. # Launch Chrome as regular user
  11. Start-Process "C:\Program Files\Google\Chrome\Application\Chrome.exe"
  12.  
  13. # Launch email client (Outlook, for example) as regular user
  14. Start-Process "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE"
  15.  
  16. # Launch ADUC with admin credentials directly in an elevated PowerShell if required
  17. Start-Process "powershell" -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"Start-Process dsa.msc -Verb RunAs`"" -Credential $credentials
  18.  
  19. # Launch Group Policy Editor the same way
  20. Start-Process "powershell" -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"Start-Process gpedit.msc -Verb RunAs`"" -Credential $credentials
  21.  
  22. # Launch MECM Configuration Manager as admin
  23. # Note: Update the path to where your MECM executable is located
  24. Start-Process "C:\Program Files (x86)\Microsoft Endpoint Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.exe" -Credential $credentials
  25.  
  26. # Launch PowerShell ISE as admin
  27. Start-Process "powershell" -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"Start-Process powershell_ise.exe -Verb RunAs`"" -Credential $credentials
Advertisement
Add Comment
Please, Sign In to add comment