The runas .NET Core Global Tool allows to run a dotnet process under a specified user account. This tool is compatible with any dotnet CLI commands but the most obvious scenario is running dotnet tests:
-
to install the runas tool, run the command line
dotnet tool install -g dotnet-runas
-
run tests under a specified user account like
dotnet runas -u:username -p:password test
-
to uninstall the runas tool, run the command line
dotnet tool uninstall -g dotnet-runas
For Windows operation system it is possible to specify elevated permissions and other parameters.
🚧 For Linux and OSX operation systems username and password paramers are available.
When building, testing, and deploying an application with TeamCity, you may need to run a build under a specific user account, different from the one used to run the build agent. The teamcity-runas plugin can be used to run TeamCity build steps under a specified user account on Windows, Mac or Linux.
runAs tool for windows
![JetBrains incubator project](https://camo.githubusercontent.com/5624fe6636cd27afdffbab28da114aa56dcb516dbdc7dd69f64d52bea410cb72/687474703a2f2f6a622e67672f6261646765732f696e63756261746f722e737667)
The runAs tool provides the ability to run a Windows process under a specified Windows user account.