Resources

Products

Install Windows Discovery Agent Service Wrapper

Modified on: Tue, 31 Mar, 2026 at 3:38 PM

The Windows Discovery Agent Service Wrapper is an executable available for i386 (32-bit) and x64 (64-bit) architectures. This service automates agent execution, ensuring inventory details are sent to Freshservice at regular intervals.

Note: Available only for new signups after the 31 March, 2026 release. If you signed up earlier, refer to the existing ITAM documentation.


Prerequisites

You need the following before the installation:

  • Ensure you have administrator privileges on the target Windows machine.

  • Set the PowerShell execution policy to RemoteSigned if using the script method.

Installation overview

To successfully install the service, you require the following three files:

  • Service Executable: Named d42_winservice_x64_v1_0_0.exe (or i386 equivalent). The default installation path is C:\Program Files\Device42.

  • Configuration File (d42config.json): This file defines the operational settings for the service. The default path is C:\ProgramData\Device42.

  • Agent Executable: Named d42_winagent_x(bit).exe. To download, go to Admin > Asset Management > Discovery Hub > Remote Collectors and Agents > External tools

You can install using the following two ways:

  • Option 1- A PowerShell script is provided for automated setup under. 

  • Option 2 - Detailed steps for manual installation using Windows Service Control.

Option 1: Using the PowerShell Script

The PowerShell script automates the placement of files based on the machine architecture. Follow these steps to install:

  1. Download the combined ZIP file and extract the contents to your local file system.

  2. Enable PowerShell remote execution by running: Set-ExecutionPolicy RemoteSigned

  3. Place the downloaded agent executable into the extracted folder.

  4. Optionally, modify the d42config.json file if you need to adjust the scan interval or add specific arguments.

  5. Run the installation script: .\D42Installer.ps1

  6. Optional, revert the execution policy if required by your security guidelines.

Option 2: Install using sc commands

If you prefer manual configuration, you can use the Windows Service Control sc tool. By default, the service wrapper looks for an agent named d42winagent.exe under C:\Program Files\Device42.

To install using sc commands, follow these steps:

  1. Save the agent executable using the correct name and location: C:\Program Files\Device42\d42winagent.exe.

  2. Create the service using the following command: sc create d42AgentService binPath= "C:\Program Files\Device42\d42_winservice_x64.exe" start= auto

Note: Ensure there is a space after the = sign in the command; this is critical for the command to execute.

  1. Start the service through the UI or the command line: sc start d42AgentService

  2. Add a description to the service for better visibility: sc description d42AgentService "D42 service that calls the agent to run every N hours to send inventory details to Device42"

To manage the service, you can use the following optional commands:

  • Query service status: sc query d42AgentService

  • Stop the service: sc stop d42AgentService

Note: On Windows, sc commands read from %windir%/system32 by default. If you do not wish to use the C:\ProgramData path, place your d42config.json in the system32 directory.

Arguments for the Config Files

The service calls the agent on service start and then again every 8 hours by default. You can override these values in the d42config.json file.

Example configuration:

{

  "executablePath": "c:\\Program Files\\Device42\\d42_winagent.exe",

  "WorkingDir": "c:\\ProgramData\\Device42",

  "arguments": ["-host=https://10.92.11.63","-skip-software=true"],

  "interval": 2

}

  • Interval: The interval can be configured between 1 and 24 hours.

  • Arguments: Each argument must be enclosed in double quotes and separated by a comma.

  • Logs: The agent_local.log file is automatically generated in the current working directory to track service activity.

Troubleshooting

Successful installation is confirmed when the service appears in the Windows Services manager and the agent log begins populating. If the service fails to start, consider the following:

  • Configuration Access: The service may be unable to read d42config.json. Ensure it is located in $ProgramData\Device42 or %windir%\system32.

  • Formatting Errors: Verify that the JSON file contains no syntax errors and that all values are correct.

  • Permissions: Confirm the account running the service has read and write access to the installation and log directories.