Skip to main content

Synopsis

Encodes a plain-text string using Triple-DES encryption with an MD5-hashed key, then Base64-encodes the result. The output is in the format LabTech uses to store sensitive values in the agent registry (passwords, proxy credentials, and similar fields).

Syntax

Parameters

string[]
required
The plain-text string to encode. Accepts an array of strings and pipeline input by value and by property name.
  • Position: 1
string
The encryption key. If not provided (or if $null is passed), the module’s built-in default key is used. To encode a value for use with a specific agent, supply that agent’s password string as the key.
  • Pipeline input: accepted by property name

Return value

Returns a string[] containing the Base64-encoded value for each input string, in the same order.

Examples

Encode a password using the default key:
Encode via the pipeline:
Encode a value using a specific agent password as the key: