> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/run-as-another-user/built-in-runas.md).

# Built-in RunAs

{% hint style="info" %}
This article describes the built in method of using \`RunAs\`. For sessions types that do not yet support the built in method you can follow the manual steps outlined in [Manual RunAs](https://docs.devolutions.net/rdm/kb/how-to-articles/running-rdm-as-another-user/).
{% endhint %}

### Settings

#### Supported types

The following types currently support ***Run As***:

| Option               | Description                                                                                      |
| -------------------- | ------------------------------------------------------------------------------------------------ |
| Session              | <ul><li>Command Line</li><li>PowerShell</li></ul>                                                |
| Macros/Scripts/Tools | <ul><li>Command Line</li><li>PowerShell Local</li><li>PowerShell Remote</li><li>PSExec</li></ul> |
| Session Add-on       | <ul><li>SQL Server Management Studio</li></ul>                                                   |

### Session

Sessions that support Run As will have a Run As tab where you specify which credentials to use when starting with Run As.

<figure><img src="https://cdnweb.devolutions.net/docs/docs_en_kb_KB4566.png" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="278">Option</th><th>Description</th></tr></thead><tbody><tr><td>None</td><td>No Run As is performed.</td></tr><tr><td>Current session</td><td>Use the same credentials as defined in the session.</td></tr><tr><td>Custom credentials</td><td>Use specified custom credentials.</td></tr><tr><td>Credential repository</td><td>Use a link credential entry.</td></tr><tr><td>Use my personal credentials</td><td>Use a link personal credential entry.</td></tr></tbody></table>

### Macros/Scripts/Tools

With tools session types you only need to specify ***Run as different user*** in ***Advanced*** tab. At execution time the credentials will be resolved and used to start the Windows Credentials unless you select ***Use session credentials***, in which case it will use those active for the session.

<figure><img src="https://cdnweb.devolutions.net/docs/docs_en_kb_KB4567.png" alt=""><figcaption></figcaption></figure>

With tools session types you only need to specify ***Run as different user*** At execution time the credentials will be resolved and used to start the Run As process.

### Session add-on

SQL Server Management Studio supports Run As. Configure it like you would configure a normal session.

<figure><img src="https://cdnweb.devolutions.net/docs/docs_en_kb_KB4568.png" alt=""><figcaption></figcaption></figure>

Click on ***Run as different user*** to modify the ***Run As*** settings.

<figure><img src="https://cdnweb.devolutions.net/docs/docs_en_kb_KB4569.png" alt=""><figcaption></figcaption></figure>

### Notes

Run as Different User and Run As Administrator are mutually exclusive.

Run as Different User does not allow for Shell Execute

#### Example: Command line session with Run as different user on the same workgroup/domain

1. Create a new Command Line session.
2. Set the command to ***CMD***.

   <figure><img src="https://cdnweb.devolutions.net/docs/docs_en_kb_KB4570.png" alt=""><figcaption></figcaption></figure>
3. Specify the ***Run As*** credentials.

   <figure><img src="https://cdnweb.devolutions.net/docs/docs_en_kb_KB4571.png" alt=""><figcaption></figcaption></figure>
4. Save your session.
5. Run your Command Line session.

   <figure><img src="https://cdnweb.devolutions.net/docs/docs_en_kb_KB4572.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devolutions.net/rdm/knowledge-base/how-to-articles/run-as-another-user/built-in-runas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
