Kaseya VSA- Agent Installation Scripts for Windows

Please use your CyberCNS Domain name in the CyberCNS Agent download link mentioned in the script as shown below:

  • cybercnstenant should be learn for CyberCNS Domain learn.

The agent Download link is as below:

https://configuration.mycybercns.com/api/v3/configuration/agentlink?ostype=windows

Installation Variables:

  • Kaseya VSA will need installation variables while running the agent installation script as these variables will decide which agent should report to which company.

  • Installation variables are unique to every company in CyberCNS and they can be found under the Probes/Agents section for a selected company.

  • Navigate to the Probes/Agents section for a company and click on Probes/Agents(with the download arrow in the right side pane) which provides the actual PowerShell command for installation.

  • As shown in the image below, Domain Name, CompanyID, ClientID, and Client Secret can be taken from the Probes/Agents deploy window.

CyberCNS Lightweight Agent Installation Script for Windows

<?xml version="1.0" encoding="utf-8"?> <ScExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting"> <Procedure name="CyberCNS Lightweight Agent Installation Script for Windows." treePres="3" id="2024552995" folderId="449806871986858" treeFullPath="Cybercns Agent"> <Body description=""> <If description=""> <Condition name="Windows 32 or 64 Bit Check"> <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" /> </Condition> <Then> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="Starting the agent procedures to install cybercns lightweight agent" /> </Statement> <Statement name="GetVariable" continueOnFail="false" osType="Windows"> <Parameter xsi:type="EnumParameter" name="VariableType" value="AgentInstallDrive" /> <Parameter xsi:type="StringParameter" name="SourceContent" value="" /> <Parameter xsi:type="StringParameter" name="VariableName" value="agentDrv" /> </Statement> <If description=""> <Condition name="CheckVariable"> <Parameter xsi:type="StringParameter" name="VariableName" value="&lt;cybercnscompanyid&gt;" /> <Parameter xsi:type="EnumParameter" name="Condition" value="Equals" /> <Parameter xsi:type="StringParameter" name="Value" value="" /> </Condition> <Then> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="CyberCns Company Id variable cannot be empty" /> </Statement> </Then> </If> <If description=""> <Condition name="CheckVariable"> <Parameter xsi:type="StringParameter" name="VariableName" value="&lt;cybercnsclientsecret&gt;" /> <Parameter xsi:type="EnumParameter" name="Condition" value="Equals" /> <Parameter xsi:type="StringParameter" name="Value" value="" /> </Condition> <Then> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="CyberCns secret Id variable cannot be empty" /> </Statement> </Then> </If> <If description=""> <Condition name="CheckVariable"> <Parameter xsi:type="StringParameter" name="VariableName" value="&lt;cybercnsdomain&gt;" /> <Parameter xsi:type="EnumParameter" name="Condition" value="Equals" /> <Parameter xsi:type="StringParameter" name="Value" value="" /> </Condition> <Then> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="CyberCns domain variable cannot be empty" /> </Statement> </Then> <Else> <If description=""> <Condition name="ServiceIsRunning"> <Parameter xsi:type="StringParameter" name="ServiceName" value="CyberCNSAgentV2" /> </Condition> <Then> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="Since Cybercns lightweight agent Process is running " /> </Statement> </Then> <Else> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="Coming inside to install the lightweight agent" /> </Statement> <Statement name="Execute Powershell" continueOnFail="false" osType="Windows"> <Parameter xsi:type="StringParameter" name="Parameter1" value="" /> <Parameter xsi:type="StringParameter" name="Parameter2" value="Invoke-WebRequest -Uri (Invoke-RestMethod -Method 'Get' -URI 'https://configuration.mycybercns.com/api/v3/configuration/agentlink?ostype=windows') -OutFile '#agentDrv#temp\cybercnsagent.exe'" /> <Parameter xsi:type="StringParameter" name="Parameter3" value="False" /> </Statement> <Statement name="ExecuteFile" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Path" value="#agentDrv#temp\cybercnsagent.exe" /> <Parameter xsi:type="StringParameter" name="Arguments" value=" -c &lt;cybercnscompanyid&gt; -a &lt;cybercnscompanyid&gt; -s &lt;cybercnsclientsecret&gt; -b &lt;cybercnsdomain&gt; -i LightWeight" /> <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" /> <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" /> </Statement> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="Successfully installed the lightweight agent " /> </Statement> </Else> </If> </Else> </If> </Then> <Else> <Statement name="WriteScriptLogEntry" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Comment" value="OS is not supported to install agent." /> </Statement> </Else> </If> </Body> </Procedure> </ScExport>

 

  • This completes the documentation of Kaseya VSA- Agent Installation Scripts for Windows.