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

ConvertTo-LTSecurity [-InputString] <string[]> [-Key <Object>] [<CommonParameters>]

Parameters

InputString
string[]
required
The plain-text string to encode. Accepts an array of strings and pipeline input by value and by property name.
  • Position: 1
Key
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:
ConvertTo-LTSecurity -InputString 'mypassword'
Encode via the pipeline:
'mypassword' | ConvertTo-LTSecurity
Encode a value using a specific agent password as the key:
$agentPassword = (Get-LTServiceInfo).ServerPassword | ConvertFrom-LTSecurity
ConvertTo-LTSecurity -InputString 'mypassword' -Key $agentPassword

Build docs developers (and LLMs) love