As a developer, there are many times where we may need to run a program in context of another user. For example, you may need to replicate an issue that a user encountered.
The RUNAS windows command line program is your friend. From the command line run the following command to launch a program in context of another user.
Note: the use of the /netonly switch. The user context is only switched during network communications. The rest of the time, the program operates in the “normal” user context.
runas /netonly /user:<DOMAIN><USERNAME> <PROGRAM_PATH>
E.g. Might not be the best example – but you get the point 🙂
runas /netonly /user:shane-desktopshane “C:\windows\system32\notepad.exe”
This blog is my place to share my thoughts, helpful solutions and just random nerdy stuff.