Overview π₯
Liongard provides a PowerShell-based installer that supports unattended deployments and environment auto-registration when supplied with the appropriate API and Agent credentials.
Use the script referenced in the following KB to install the Liongard Agent:
Prerequisites ποΈ
Before deploying the agent, ensure the following:
You have Liongard API credentials:
API Token Key
API Token Secret
You have Agent registration credentials:
Agent Token Key
Agent Token Secret
The target machine:
Is running Windows 10 / Windows Server 2016 or newer
Has outbound HTTPS access (TCP 443)
Can execute PowerShell scripts
Your RMM runs the script as SYSTEM or Administrator
PowerShell execution policy is not blocking script execution (the examples below bypass this explicitly)
Required Script Variables π
The PowerShell script expects the following variables to be populated, either directly in the script or via RMM-provided parameters:
Variable Name | Description |
| Liongard region (for example: |
| Liongard API Token Key |
| Liongard API Token Secret |
| Liongard Agent Token Key |
| Liongard Agent Token Secret |
| Liongard Environment Name (typically the customer or organization name) |
β¨ Best Practice:
Use RMM variables to dynamically populate the $Environment value, so agents automatically register under the correct Liongard environment.
RMM-Specific Deployment Examples π§βπ«
1οΈβ£ Datto RMM
Create Component
Navigate to Automation β Components
Select New Component
Component Configuration
Field | Value |
Category | Script |
Script Type | PowerShell |
Script | Paste the contents of |
Variables to Map
Datto Variable | Script Variable |
InstancePrefix |
|
ApiTokenKey |
|
ApiTokenSecret |
|
AgentTokenKey |
|
AgentTokenSecret |
|
Environment |
|
Execution Command
powershell.exe -ExecutionPolicy Bypass -File "LGAgentScript.ps1"
2οΈβ£ ConnectWise Automate (CWA)
Script Setup
Create a new script
Add Execute Script β PowerShell
Run as SYSTEM
Parameter Section Example
Set-Variable InstancePrefix "us1"
Set-Variable ApiTokenKey "YOUR_API_KEY"
Set-Variable ApiTokenSecret "YOUR_API_SECRET"
Set-Variable AgentTokenKey "YOUR_AGENT_KEY"
Set-Variable AgentTokenSecret "YOUR_AGENT_SECRET"
Set-Variable Environment "%ClientName%"
β %ClientName% automatically inserts the ConnectWise Automate client name and is recommended for environment consistency.
3οΈβ£ NinjaOne
Script Configuration
Navigate to Configuration β Scripting
Select Add Script
Paste
LGAgentScript.ps1into the editor
Parameters Example
InstancePrefix = "us1"
ApiTokenKey = "YOUR_API_KEY"
ApiTokenSecret = "YOUR_API_SECRET"
AgentTokenKey = "YOUR_AGENT_KEY"
AgentTokenSecret = "YOUR_AGENT_SECRET"
Environment = $msg.organization_name
β $msg.organization_name dynamically resolves to the NinjaOne organization name.
4οΈβ£ Kaseya VSA
Upload the script to the agentβs temporary directory:
#vAgentConfiguration.agentTempDir#\LGAgentScript.ps1
Execute Command
powershell.exe -ExecutionPolicy Bypass -File "#vAgentConfiguration.agentTempDir#\LGAgentScript.ps1"
βΌοΈ Note:
Ensure variables are either hard-coded in the script or injected via Kaseya script parameters prior to execution.
Post-Deployment Validation π¨βπ»
After deployment:
Confirm the agent appears in the Liongard UI
Verify:
The agent is associated with the correct Environment
The agent status is Online
Confirm inspections begin running according to schedule
Troubleshooting Tips π
Agent does not appear
Verify API and Agent credentials
Confirm outbound HTTPS connectivity
Agent registers to the wrong environment
Validate the
$Environmentvariable passed by the RMM
Script fails to run
Ensure execution policy bypass is enabled
Confirm script is running as SYSTEM or Administrator