Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When a Cloudbridge script is run, the Cloudbridge platform defines several variables to store the Connect IDs that were assigned to that script. Those variables are as follows:  

Name 

Type 

Details 

$ConnectId 

Hashtable 

Contains details for the "RunAs" Connect Id for the script. The credentials for the "RunAs" Connect ID can be retrieved by using Get-Credential. 

$ConnectIds 

Hashtable 

Contains details for all Connect Ids that are available to the script (including the "RunAs" Connect Id). This variable also contains the credentials for each Connect Id that can be used to connect to systems within the script. 

 How you retrieve credentials a Connect Id depends on whether or not you want the credentials for the "RunAs" Connect Id, or for one of the available Connect Ids. 

...

Info

$ConnectId is a global variable made available automatically to all scripts; it holds the current ConnectID.

Get-Credential is intercepted by the platform and returns $ConnectId.Credentials

For example: 

Code Block
# This command would retrieve the credentials for the "RunAs" Connect Id 

$runAsCredentials = Get-Credential 

...

Note

Because Cloudbridge has a reserved $ConnectID variable that contains the current executing ConnectID reference, do not use this variable name when retrieving your available ConnectID's from the $ConnectIDs collection.

ConnectId Properties

Below is a list of all properties available on a ConnectId stored in $connectIds $connectId, along with a description of the property and the type of Connect Id for which property is applicable.

Property Name 

Description 

Connect Id Type

Name 

Name

The name of the Connect Id. This is used as the key for connect Ids stored in the $connectIds collection.

All

Type 

Type

The type of Connect Id. 

All 

URL 

URL

The URL associated with the Connect Id. 

Email, Generic 

Credentials 

Username

Username on the Connect Id.

All

Credentials

The credentials stored in the Connect Id. 

All 

SmtpServer 

SmtpServer

The (domain) name of the SMTP server. 

Email 

Port 

Port

The port to use for the SMTP server. 

Email 

ServiceNowUrl 

ServiceNowUrl

The URL to use to connect to ServiceNow. 

Service Now 

RunUser

All RunAs

variableName

Any variable name created on the Connect Id.

All

ConnectId Properties

A ConnectId has the following available properties:

Property Name

Description

Credential

Holds the PSCredential associated with the ConnectID

Name

The name given to the ConnectID

Type 

The Type of ConnectId, eg.

  • Microsoft Cloud

  • On-Prem Proxy

  • Email

  • Service Now

  • Generic

 RunUser

The Cloudbridge user currently running the script. 

variable name 

Any variable names created on the ConnectID 

Creating ConnectIDs (The Credential Vault)