HardwareIds.NET 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package HardwareIds.NET --version 2.0.0
                    
NuGet\Install-Package HardwareIds.NET -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HardwareIds.NET" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HardwareIds.NET" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="HardwareIds.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HardwareIds.NET --version 2.0.0
                    
#r "nuget: HardwareIds.NET, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HardwareIds.NET@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HardwareIds.NET&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=HardwareIds.NET&version=2.0.0
                    
Install as a Cake Tool

HardwareIds.NET

Simple .NET library capable of tracking users across re-installs and hardware swapping,
and even entirely new computers using the neighborhood's network endpoints.

How does it work?

HardwareIds.NET will enumerate every single hardware component plugged-in/installed on the computer,
query their unique identifiers (like serial numbers, mac addresses, etc...) and go even beyond that,
by scanning network endpoints (WiFi) and routers available that are transmitting packets close to the computer.

This library will also take care of scanning the current network (WiFi/Ethernet) the computer is connected to,
and retrieve the MAC address of every device connected, like printers, Smart TVs, phones, etc...

Everything is read straight from the Windows APIs, without WMI: the SMBIOS table (GetSystemFirmwareTable),
storage and NDIS device IOCTLs, the PnP configuration manager, the EDID blocks of the monitors, the registry,
NetUserEnum, the print spooler, the display configuration API and the native Wi-Fi API (WlanAPI). A full scan (without the network scans)
takes about 10 ms, does not need administrator rights, does not depend on the WMI service, and the library has no third-party dependencies.

The values returned are the same ones WMI reports, so identifiers collected with previous versions keep matching.
On top of them, version 2.0 adds identifiers WMI never exposed: every serial number a disk reports (descriptor, NVMe or ATA identify,
SCSI device identification page, Windows DUID) as separate fields, together with its firmware, World Wide Name and partition table GUID, the PnP
instance path of disks, adapters, monitors and video controllers, the EDID hash and manufacture date of monitors, the chassis
(enclosure) serial number and asset tag, Bluetooth radio addresses, battery serial numbers, and the machine GUID, hardware
profile GUID, precise install time and machine SID of the Windows installation.

Requirements

  • Windows (the library relies on the SMBIOS table, the PnP manager, the registry and the native Wi-Fi API).
  • .NET 10 or .NET Framework 4.8.

Installation

PM> Install-Package HardwareIds.NET

or

dotnet add package HardwareIds.NET

Example

using HardwareIds.NET;

var Hwid = await HardwareIds.GetHwidAsync(new HardwareIdsConfig {
  ScanLocalNetworkDevices = false,
  ScanNeighborEndpoints = true,
  DurationOfNetworkScan = TimeSpan.FromSeconds(5)
});

foreach (var Disk in Hwid.Disks)
{
    Console.WriteLine($"  DISK->ID:       {Disk.Id}");
    Console.WriteLine($"  DISK->NAME:     {Disk.Model}");
    Console.WriteLine($"  DISK->SN:       {Disk.SerialNumber}");
}

// The result can be serialized as-is with System.Text.Json.
var Json = JsonSerializer.Serialize(Hwid);

Tests

The HardwareIds.NET.Tests project holds unit tests for the SMBIOS and EDID parsers (using synthetic tables) and integration tests that run every collector on the local machine and compare the results with WMI. Run them with:

dotnet test

Tests that depend on hardware or privileges that are missing (no Wi-Fi interface, no monitor EDID, non-elevated process) are skipped rather than failed.

Licence

This work is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.0 109 10/6/2026
2.1.1 112 9/23/2026
2.1.0 105 9/23/2026
2.0.0 112 9/16/2026
1.1.12 379 9/7/2025
1.1.11 217 9/7/2025
1.1.10 317 5/11/2025
1.1.9 634 5/6/2024
1.1.8 370 3/27/2024
1.1.7 281 2/19/2024
1.1.6 461 6/22/2023
1.1.5 492 2/21/2023
1.1.4 850 3/7/2022
1.1.3 566 8/20/2021
1.1.2 548 8/14/2021
1.1.1 544 8/11/2021
1.1.0 541 8/10/2021
1.0.0 594 6/7/2021

Hardware information is now read directly from the Windows APIs (SMBIOS, storage and NDIS IOCTLs, PnP, EDID, registry, spooler, WlanAPI) instead of WMI and wrapper libraries: a scan takes about 10 ms instead of seconds, and the library has no third-party dependencies anymore. New identifiers: per-disk NVMe, ATA, SCSI VPD and DUID fields, firmware, WWN and partition table GUID; PnP instance paths; monitor EDID hash and manufacture date; chassis; Bluetooth radios; batteries; machine GUID, hardware profile GUID, install time and machine SID. Public API unchanged (additive); targets .NET 10 and .NET Framework 4.8.