PowerShell Cmdlets for Credentials Management

Prev Next

You can use the following PowerShell cmdlets to manage ControlUp user credentials:

The ControlUp.PowerShell.User module contains the PowerShell cmdlets mentioned in this article.

To load the module, open an elevated PowerShell session as administrator and run the following commands:

$pathToUserModule = (Get-ChildItem "C:\Program Files\Smart-X\ControlUpMonitor\*ControlUp.PowerShell.User.dll" -Recurse | Sort-Object LastWriteTime -Descending)[0]
Import-Module $pathToUserModule
    

Add-CUCredentials

Syntax

Add-CUCredentials 
    -User or ClientId (string) 
    -Password or SecretKey (SecureString) 
    -Domain (string) 
    -SiteName (string)
    -FriendlyName (string)
    -IsCloud or -ShareWithUser (string)
    

Description

Creates new ControlUp user credentials using input parameters as either shared credentials or monitor credentials. Note that this cmdlet doesn't validate or test credentials before creating them.

Parameters

Parameter

Description

Required

-User

Creates user name

Yes, if creating shared credentials

-Password

Switch parameter for -SecretKey, password to create shared credentials.

Yes, if creating shared credentials

-Domain

Domain name

Yes, if creating shared credentials

-SiteName

Name of the specific site to which the credentials will be associated. If not provided, all sites in your organization will be used by default.

No

-FriendlyName

Unique name of the credentials used to more easily identify them. Generated by default in format “Domain\UserName“. Add-CUCredentials checks if this parameter already exists among the credentials, if yes, the exception will be thrown.

No

-ClientId

User’s unique ID.

Yes, if creating monitor credentials

-SecretKey

Switch parameter for -Password, secret key to create monitor credentials.

Yes, if creating monitor credentials

-IsCloud

Switch parameter for -ShareWithUser, creates monitor credentials.

Yes, if creating monitor credentials

-ShareWithUser

Switch parameter for -IsCloud, creates shared credentials.

Yes, if creating shared credentials

Examples

To create shared credentials:

Add-CUCredentials 
    -User UserName.Test -Password $PasswordSecureString -Domain cucorp.controlup.com -SiteName Default -FriendlyName MyNewCredentials -ShareWithUser 

To create monitor credentials:

Add-CUCredentials 
    -Add-CUCredentials -ClientId TestClientId -SecretKey $SecretKeySecureString -FriendlyName MyNewCloudCredentials -IsCloud 

Remove-CUCredentials

Syntax

Remove-CUCredentials 
    -Key (string)

Description

Removes existing shared credentials or monitor credentials by key.

Parameters

Parameter

Description

Required

-Key

Unique ID of the credentials. To receive the key, use the Get-CUSystemCredentials cmdlet.

Yes

Example

Remove-CUCredentials 
    -Key 4dd703af-c57d-472e-9edd-86d018d19bb3

Set-CUCredentialsPassword

Syntax

Set-CUCredentialsPassword 
    -Key (string)  
    -NewPassword (SecureString)

Description

Updates the password for existing shared credentials or monitor credentials by key. Note that this cmdlet doesn't validate credentials before saving them with the new password.

Parameters

Parameter

Description

Required

-Key

Unique ID of the credentials. To receive the key, use the Get-CUSystemCredentials cmdlet.

Yes

-NewPassword

New password to update the credentials.

Yes

Example

Set-CUCredentialsPassword 
    -Key 43c0a89c-be4d-4684-8a72-16aca73875d2
    -NewPassword $NewPasswordSecureString