< Back

New-CBSession

Mon Jan 13, 2020 3:29 am

NAME New-CBSession



SYNOPSIS

Creates a connection to CloudBolt instance.





SYNTAX

New-CBSession [-Uri] <Uri> [-Credential] <PSCredential> [[-Domain] <String>] [<CommonParameters>]





DESCRIPTION

The `New-CBSession` function creates a connection to a CloudBolt instance. Pass the URI to the instance to the

`Uri` parameter. Pass the credentials to use to authenticate to the `Credential` parameter.



The function generates a token for further access to the CloudBolt API using the credentials by making a request

to the `/api/v2/api-token-auth` endpoint.



If your instance of CloudBolt authenticates against a domain, pass the domain to the `Domain` parameter.





PARAMETERS

-Uri <Uri>

The URI to the CloudBolt instance to connect to.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

The credentials to use.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Domain <String>

The domain to use.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-CBSession -Uri 'https://cloudbolt.example.com' -Credential $me



Demonstrates how to connect to an instance of CloudBolt. In this case, the connection is to the instance at

`https://cloudbolt.example.com` using the credentials in the `$me` variable.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-CBSession -Uri 'https://cloudbolt.example.com' -Credential $me -Domain 'CB'



Demonstrates how to connect to an instance of CloudBolt and the credential is in a specific domain. In this case,

the credential is in the `CB` domain.











RELATED LINKS