Running Programs as Different User

by Oct 28, 2010

If you ever needed to run a program as someone else, you can use Start-Process and supply alternate credentials. When you do that, you should also make sure you specify -LoadUserProfile to load the user profile unless you do not need it:

Start-Process powershell -LoadUserProfile -Credential (Get-Credential)

With UAC enabled, this will always launch the program without administrator privileges. However, you can elevate another console from here if you like, and it will continue to run as the user you specified to launch the first program.

Twitter This Tip!
ReTweet this Tip!