Configuring HWID

The agent uses a Unique Disk Identifier (HWID) to register with the server and establish communication with the monitoring service.

Starting from Staffcop Enterprise version 5.5 and Windows agent version 5.8.2583, new HWID management parameters are available. These parameters enable you to:

  • Select the HWID type to use during installation.

  • Remove the current HWID from the registry and install a new one.

Note

HWID parameters are optional. By default, the HWID is automatically generated based on the computer’s unique hardware data.

There are two ways to pass parameters:

  • You can manage the msiexec command on the command line. This is typically used for silent installation or installation from Active Directory.

  • Alternatively, you can change the name of the MSI file. Use this method for Remote Installation Utility or local installation.

HWID Parameters

The following parameters are used to define the HWID based on the selected method. These settings determine how the HWID is generated and whether it is persistent across sessions.

  • hwid — The HWID value generated based on the selected type: HWID, HWID-FQDN, or FQDN.

  • use_fqdn — Defines the type of HWID to use. The available values are:

  • 0 (no parameter set) — HWID: This is an identifier based on unique computer hardware data in GUID format, for example: 076ee660-54b6-49c3-baaf-b0f8bb81f9e1. It’s stored in the registry and remains unchanged even if the computer name or network settings change. If deleted, it will be regenerated.

  • 1 — HWID-FQDN: Combines hardware data with the computer’s Fully Qualified Domain Name (FQDN) in lowercase. It’s saved in the registry and doesn’t change. If deleted, it will be regenerated.

  • 2 — FQDN: The Fully Qualified Domain Name of the computer, not saved or read from the registry. This value is generated each time the agent starts. If deleted, it won’t be recreated.

Note

The HWID type and value are stored in the registry branch: HKEY_LOCAL_MACHINESYSTEMSCHWID.

Setting Parameters via the msiexec Command

To manage HWID settings, two new parameters can be added to the msiexec agent installation command:

  • DROPHWID:

  • DROPHWID=1 — Deletes the current HWID and generates a new one.

  • DROPHWID=0 — Retains the current HWID.

If the value is incorrect, the HWID type will not change, and an error message will be logged in the installer log.

  • HWIDMODE:

  • HWIDMODE=HWID, HWIDMODE=HWIDFQDN, HWIDMODE=FQDN — Defines the HWID type. If an invalid value is provided, an error will be logged.

Here is an example of a command that will delete the current HWID and set the HWID-FQDN:

msiexec.exe /norestart /l*vx install.log /qn /i "C:\Windows\agent.msi" GATE_URL="staffcop_server" GATE_URL2="staffcop_server_reserve" GATE_PORT=port GATE_PORT2=port2 ALLUSERS=1 REBOOT=ReallySuppress DROPHWID=1 HWIDMODE=HWIDFQDN

Note

If parameters are provided both within the MSI file and on the command line, the command line parameters will take precedence.

Setting Parameters During Delayed Installation

The new parameters can be also applied during a delayed installation.

Here’s an example of a command that resets the HWID and applies the HWID-FQDN parameter after a system reboot:

msiexec.exe /i "Agent.msi" /qn /l*vx "install.log" GATE_URL="main.server.url" ALLUSERS=1 REBOOT=ReallySuppress REINSTALLMODE=amus DROPHWID=1 HWIDMODE=HWIDFQDN AGENT_FORCE_REBOOT=delayed

Setting Parameters via the MSI File Name

Starting from agent version 1.2.0.18, the Remote Installation Utility supports passing HWID parameters via the name of the MSI file.

Before running the utility, add the following substrings to the file name:

  • drophwid — Deletes the current HWID from the registry and generates a new one.

  • hwidmode=hwid, hwidmode=hwidfqdn, or hwidmode=fqdn — Specifies the HWID type.

Rules for specifying parameters:

  • Parameters can be specified in any order.

  • Parameters are case insensitive.

  • One or both parameters may be omitted.

  • If a parameter is not set or is set incorrectly, the HWID type will not change. Invalid value errror will be logged.

  • The server extracts the HWID parameters from the file name and ignores any server URLs in the MSI file name. Instead, the server URLs are retrieved from the utility settings.

Here is an example of a file name that will replace the current HWID with HWID-FQDN:

Agent[main.server.url{reserve.server.url}]-drophwid-hwidmode=hwidfqdn.msi

where the minus sign ( - ) is a separator character.

Warning

Do not use the renamed MSI file for the Repair operation if it shares the same Product Code. The operation will fail because Windows Installer would not be able to locate the correct installation file by its original name.

Repair is a Windows Installer feature that restores or fixes an installed program if it is malfunctioning, or if some files are missing or damaged.

ProductCode is a unique identifier (GUID) for each MSI-package that Windows Installer uses to identify and manage installed programs. It helps the system distinguish between different versions of a program, particularly during updates, repairs, or uninstalls. If multiple MSI packages share the same ProductCode, Windows considers them to be the same program.