# Open-VaultConnection Connects to the specified Vault Server. ## Syntax ```powershell Open-VaultConnection [-Vault ] [-Server ] [-User ] [-Password ] ] ``` ## Parameters | Type | Name | Description | Default value | Optional | |--------|----------|-------------------------------------------------------------------------|---------------|----------| | String | Vault | The name of the vault for which the connection should be made | Vault | yes | | String | Server | The Ip or hostname of the server on which the Vault server is installed | localhost | yes | | String | User | A valid user, that is able to login to the target Vault | Administrator | yes | | String | Password | The users password | "" | yes | ## Return type **empty** \<- On failure the Exception/ErrorMessage can be accessed using [\$Error](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1#error). ## Remarks When the commandlet could successfully establish a connection to Vault, following powershell variables are created which let you communicate directly to Vault through it's API: - [$vault](/code_reference/objects/vault) - [$vaultconnection](/code_reference/objects/vaultconnection) - [$vaultExplorerUtil](/code_reference/objects/vaultexplorerutil) If the application already has an open Vault connection, the commandlet does not recreate a new connection, and **reuses the existing connection** to create the previous variables in the powerShell session.\ Therefore the cmdlet can be used e.g. in Vault-Explorer without any arguments, in order to prepare the powerShell Runspace with the correct powerShell variables for the current session.