--- title: "Connect-NectarCloud" slug: "connect-nectarcloud" updated: 2024-08-20T14:27:03Z published: 2024-08-20T14:27:03Z canonical: "support.nectarcorp.com/connect-nectarcloud" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.nectarcorp.com/llms.txt > Use this file to discover all available pages before exploring further. # Connect-NectarCloud Connects to Nectar DXP cloud and store the credentials for later use. ## Syntax ``` Connect-NectarCloud -CloudFQDN -TenantName -Credential -CredSecret -UseToken ``` ## Examples ### Example 1 ``` $Cred = Get-Credential ``` Connect-NectarCloud -Credential $cred -CloudFQDN contoso.nectar.services Connects to the contoso.nectar.services Nectar DXP cloud using the credentials supplied to the Get-Credential command ### Example 2 ``` Connect-NectarCloud -CloudFQDN contoso.nectar.services -CredSecret MyNectarCreds ``` Connects to contoso.nectar.services Nectar DXP cloud using previously stored secret called MyNectarCreds ### Example 3 ``` Connect-NectarCloud -CloudFQDN contoso.nectar.services -UseToken ``` Connects to contoso.nectar.services Nectar DXP cloud using previously stored token stored in a Microsoft Secret Vault called contoso.nectar.services-accesstoken ## Parameters **-CloudFQDN ** The FQDN of the Nectar DXP cloud. | Parameter | Value | | --- | --- | | Required | false | | Position | 1 | | Required | false | | Default Value | None | | Accept pipeline input? | true (ByValue) | | Accept wildcard characters? | false | **-TenantName ** The name of a Nectar DXP cloud tenant to connect to and use for subsequent commands. Only useful for multi-tenant deployments | Parameter | Value | | --- | --- | | Required | false | | Position | 2 | | Required | false | | Default Value | None | | Accept pipeline input? | true (ByPropertyName) | | Accept wildcard characters? | false | **-Credential ** The credentials used to access the Nectar DXP UI. Normally in username@domain.com format | Parameter | Value | | --- | --- | | Required | false | | Position | 3 | | Required | false | | Default Value | None | | Accept pipeline input? | true (ByPropertyName) | | Accept wildcard characters? | false | **-CredSecret ** Use stored credentials saved via Set-Secret. Requires prior installation of Microsoft.PowerShell.SecretManagement PS module and an appropriate secret vault, such as Microsoft.PowerShell.SecretStore. Locally, the Microsoft.PowerShell.SecretStore can be used to store secrets securely on the local machine. This is the minimum requirement for using this feature. Install the modules by running: Install-Module Microsoft.PowerShell.SecretManagement Install-Module Microsoft.PowerShell.SecretStore Register a credential secret by doing something like: Set-Secret -Name NectarCreds -Vault SecretStore -Secret (Get-Credential) | Parameter | Value | | --- | --- | | Required | false | | Position | 4 | | Required | false | | Default Value | None | | Accept pipeline input? | true (ByPropertyName) | | Accept wildcard characters? | false | **-UseToken ** Use a JWT (JSON web token) to connect to Nectar DXP instead of using credentials. This feature uses the Microsoft.PowerShell.SecretManagement PS module, which must be installed and configured with a secret store prior to using this option. The PS SecretManagement module can use any number of 3rd party secret stores that provide access to centralized secret management tools, such as Keeper and AWS Secrets. Locally, the Microsoft.PowerShell.SecretStore can be used to store secrets securely on the local machine. This is the minimum requirement for using this feature. Install the modules by running: Install-Module Microsoft.PowerShell.SecretManagement Install-Module Microsoft.PowerShell.SecretStore When **-UseToken** is selected, the function will check for a secret called ***envname***-accesstoken (ie contoso.nectar.services-accesstoken). The secret must contain two fields called **AccessToken** and **RefreshToken** and must be writable. The token itself can be generated in the Nectar DXP UI or via **New-NectarToken** (when logged in with a local account). **New-NectarTokenRegistration** can be used to generate a token using the default secret store (if supported by the secret store). If using the default Microsoft SecretStore, you can generate a token and save it as a secret on the local machine by running: New-NectarToken -TokenName ***tokenname*** | New-NectarTokenRegistration -CloudFQDN ***NectarDXPFQDN*** ie. New-NectarToken -TokenName laptop | New-NectarTokenRegistration -CloudFQDN contoso.nectar.services | Parameter | Value | | --- | --- | | Required | false | | Position | named | | Required | false | | Default Value | False | | Accept pipeline input? | false | | Accept wildcard characters? | false |