5

#PSTip Start PowerShell as a different user with elevated privileges

Note: This tip requires PowerShell 2.0 or above.

This command is useful when you want to perform some tests or if you work in an environment where you use the standard and admin user accounts. Open Command Prompt and run the following command:

C:\> C:\Windows\System32\runas.exe /env /noprofile /user:CHANGEME@TEST.LOCAL "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -command \"start-process powershell -verb RunAs\""

The best way to use it is to create a shorcut on your desktop and put it in the Target field.

Filed in: Columns, Tips and Tricks Tags: ,
© 2018 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: