HWID - Unique disk identifier

A unique identifier serves to secure the agent in the system and the data it transmits to the server. The agent takes hwid in this order:

  • Serial number of the hard drive.

  • If there is an error, then MAC.

  • If there is an error, then the volume serial number.

Note

In the agent, starting from version 5.8.2478 and later, hwid is generated automatically in the registry.

Note

From version 5.8.2583 of iBatyr Monitor for Windows agents, it is possible to generate HWID via adding HWID parameters to the command line or naming the agent installation MSI file.

In the agent, starting from version 5.8.2450 and later, it is possible to set hwid in the Windows registry; you need to create a value of the form REG_SZ.

[HKEY_LOCAL_MACHINE\SYSTEM\SCHWID]
«hwid»=«1111-2223»

It is also advisable to adjust HWID if there is an error Wrong CN! in the agent log

Edit the registry value hwid, excluding spaces from there.

Or create a file with content (set your HWID value using the template XXXX-YYYY)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\SCHWID]
«hwid»=«1111-2223»

Automatic generation of HWID

Creates/replaces the hwid value in the registry. The text below must be copied and pasted into a file, for example hwid.bat.

@echo off
reg query "HKLM\SYSTEM\SCHWID" /v "hwid" > null
set I=22
set N=16
set CHAR=0 1 2 3 4 5 6 7 8 9 A B C D E F
set Hex=0
:LOOP
set /a R=1+%N%*%random%/32768
for /f "tokens=%R%" %%q in ("%CHAR%") do (set Hex=%%q%Hex%)
Set /a I-=1
If %I% GTR 0 goto LOOP
echo %Hex%
reg add HKLM\SYSTEM\SCHWID /f /v hwid /t REG_SZ /d %Hex%
:end

You can run this script using the following command:

cmd.exe /c hwid.cmd

After this, the unique identifier will be written to the system registry and will never be able to change again.

Unique HWID

In some cases, an HWID conflict occurs and agent information is displayed incorrectly. For example, there are domain computers and VDI, where a workstation image with pre-installed software and layers with profile data for users are used. To solve the problem, a new option was invented that works starting from agent version 5.8.2539.

To create a unique HWID, you need to add a DWORD (32) format key called use_fqdn to the registry key HKEY_LOCAL_MACHINE\SYSTEM\SCHWID with the following values:

0 or none - the logic for obtaining HWID as it is now

1 - instead of the disk ID, the fully qualified domain name (FQDN) of the computer is used in lower case, saved in the registry and later used from the registry.

2 - The fully qualified domain name (FQDN) is used, but is not stored in the registry (the hwid parameter is not used). If the computer name is changed, the HWID changes.

Attention

If the HWID is generated, it must be removed from the registry. Otherwise, the HWID will not change.