Connect-NectarCloud
    • 20 Aug 2024
    • 2 Minutes to read
    • Dark
      Light
    • PDF

    Connect-NectarCloud

    • Dark
      Light
    • PDF

    Article summary

    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.

    ParameterValue
    Requiredfalse
    Position1
    Requiredfalse
    Default ValueNone
    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

    ParameterValue
    Requiredfalse
    Position2
    Requiredfalse
    Default ValueNone
    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

    ParameterValue
    Requiredfalse
    Position3
    Requiredfalse
    Default ValueNone
    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)

    ParameterValue
    Requiredfalse
    Position4
    Requiredfalse
    Default ValueNone
    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

    ParameterValue
    Requiredfalse
    Positionnamed
    Requiredfalse
    Default ValueFalse
    Accept pipeline input?false
    Accept wildcard characters?false

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence