- 20 Aug 2024
 - 2 Minutes to read
 
- Print
 - DarkLight
 - PDF
 
Connect-NectarCloud
- Updated on 20 Aug 2024
 - 2 Minutes to read
 
- Print
 - DarkLight
 - PDF
 
Connects to Nectar DXP cloud and store the credentials for later use.
Syntax
Connect-NectarCloud
  -CloudFQDN  <String>
  -TenantName  <String>
  -Credential  <PSCredential>
  -CredSecret  <String>
  -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 <String>
 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 <String>
 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 <PSCredential>
 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 <String>
 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 <SwitchParameter>
 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 |