Install Windows Domotz Collector via scripting
You can install and configure the Domotz Collector on Windows OS silently. Doing so means you can include the Domotz Collector on Windows in a script that you can execute, install, and configure remotely using an RMM solution for endpoints.
You can achieve the Domotz Collector installation in silent mode by executing the following command from an Administrator command-line shell:
domotz-windows-x64.exe /S /D=%DOMOTZ_BASE_DIR%
Follow the next steps, once you install the Domotz Collector on your Windows machine.
Install Domotz Collector via scripting
The following PowerShell script provides an example using the instructions above. If you execute the following with Administrator privileges on a Windows machine, it will:
- Download the latest version of the Windows Domotz Collector.
- Download the following script: https://raw.githubusercontent.com/domotz/support_scripts/main/windows_install_scripts/src/windows_agent_installation_and_activation_script.ps1
Once download is complete please edit it and set the following variables:
$AgentName: this is the name of the Collector that you are willing to configure and activate
$ActivationKey: this is your personal Collector Activation API Key
$ApiEndpoint: this is the Base URL API Endpoint as reported at the time of the creation of the Collector Activation API Key and in the Portal (under Settings - API Key section)
Please see here how to get your Activation Key: https://help.domotz.com/user-guide/domotz-api/
The script assumes you execute it on the same Windows machine where you are planning to install and configure the Domotz collector. Additionally, you can use it for external RMM solutions (ConnectWise Automate, Datto RMM, Syncro, Ninja RMM, Atera, etc) to remotely install, configure and activate new Domotz Collectors at your customer sites.
Uninstall the Domotz Windows Collector Silently
You can achieve the uninstall of the Domotz Collector in silent mode by executing the following command from an Administrator command-line shell:
uninstall.exe /S /D=%DOMOTZ_BASE_DIR%
Or you can use this script which should be run in an Administrative mode Powershell:
Domotz Collector Activation via Command line
This next section covers Domotz Collector Activation via Command line. You can activate and configure a new Domotz Collector via command line (or API) by using a Collector Activation API Key.
Every Domotz Collector, starting from version 3.3.0, listens on port 3000 (http) which you can use to activate and configure it.
Use this automatic script on Windows:
Use the following to activate the collector using Linux:
1. Declare the variables accordingly with your scenario:
X_API_KEY="HFHZOeVieW7U0ixQvJ1c"
AGENT_NAME=""
DOMOTZ_PUBLIC_ENDPOINT="https://api-eu-west-1-cell-1.domotz.com/public-api/v1/"
DOMOTZ_AGENT_IP="10.0.0.1"
2. Activate the Collector with the following curl:
curl -v -X POST -H "x-api-key: ${X_API_KEY}" -d "{\"name\": \"${AGENT_NAME}\", \"endpoint\": \"${DOMOTZ_PUBLIC_ENDPOINT}\", \"deny_all_interfaces\": false}" http://${DOMOTZ_AGENT_IP}:3000/api/v1/agent
Activation with Network Scanning Disabled
Starting from version 3.9.3 you can activate a collector passing an additional optional boolean field “deny_all_interfaces” in the request body. If true, the collector will not scan any network unless a specific “allow” configuration is passed using the Set Network Interfaces Policy method of the Public-API:
curl -v -X POST -H "x-api-key: ${X_API_KEY}" -d "{\"name\": \"${AGENT_NAME}\", \"endpoint\": \"${DOMOTZ_PUBLIC_ENDPOINT}\", \"deny_all_interfaces\": true}" http://${DOMOTZ_AGENT_IP}:3000/api/v1/agent
You can find a PowerShell script to activate a collector with Network Scanning Disabled on Windows here: https://github.com/domotz/support_scripts/blob/main/windows_install_scripts/src/windows_agent_installation_and_activation_script_scanning_disabled.ps1


