# addconnection

![Parralels](https://www.parallels.com/static/pl/fileadmin/res/img/navigation/pl-logo-dk.png)

## AppserverClient Command Line Interface

### addconnection

creates a new connection with or without showing the UI.

**Category: Connections**

```
AppServerClientCLI addconnection [-type ras/rdp] [-server 10.2.3.4]  [-username user] [-password pwd] [-alias alias] [-mode 0] [-port 443] [-window 12345]  
```

### Arguments

* **`type (optional)`** Specify the type of connection to add, which can be either RAS or RDP.
* **`server (optional)`** Specify the server to connect to.
* **`username (optional)`** Specify the username.
* **`password (optional)`** Specify the password.
* **`alias (optional)`** Specify the display name of the connection.
* **`mode (optional)`** Specify the connection mode.
* **`port (optional)`** Specify the port to connect to. If not specified, port 443 will be used.
* **`window (optional)`** Specify the window handle that will be used as the parent to any UI required.

### Return codes:

ok - Command was successful\
NotAvailable - Communication with the client backend failed, ensure that the client is running\
InvalidArgs - Some arguments are missing or invalid\
AlreadyPresent - New connection cannot be added since the server and friendly name are already used\
AccessDenied - Logged on user does not have permission to perform the action\
ElevationAccess - CLI process is running at a higher process privilege\
Exception - System problem

### Examples:

AppServerClientCLI addconnection\
AppServerClientCLI addconnection -type rdp\
AppServerClientCLI addconnection -type ras -server myserver -username user -password pwd\
AppServerClientCLI addconnection -type rdp -server myserver -username user -password pwd

### Notes:

If you do not pass any arguments, or specify the type only, the UI will be used to enter the remaining information.\
If you need to add a connection without UI, you need to specify the server, username and password. Other arguments are optional.

### See also:

[listconnections](/landing/ras-windows-cli-guide/v20/commands/listconnections.md)\
[updateconnection](/landing/ras-windows-cli-guide/v20/commands/updateconnection.md)\
[duplicateconnection](/landing/ras-windows-cli-guide/v20/commands/duplicateconnection.md)\
[deleteconnection](/landing/ras-windows-cli-guide/v20/commands/deleteconnection.md)\
[getshareddevice](/landing/ras-windows-cli-guide/v20/commands/getshareddevice.md)\
[setshareddevice](/landing/ras-windows-cli-guide/v20/commands/setshareddevice.md)\
[clearshareddevice](/landing/ras-windows-cli-guide/v20/commands/clearshareddevice.md)


---

# Agent Instructions: 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.parallels.com/landing/ras-windows-cli-guide/v20/commands/addconnection.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.
