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.
Latest posts by Shane Bartholomeusz (see all)
- MB2-716 Dynamics 365 Exam Guide - 16th May 2019
- How To: Backup Synology NAS to Azure Cloud - 11th April 2019
- How To: Create Dynamics 365 Entity Relationship Diagram - 13th March 2019