Share via

generating a device‑related identifier

Anjali Narvekar 0 Reputation points
2026-02-05T09:46:32.09+00:00

I’m working on a UWP application where we need to associate a device with app‑specific logic (for example, licensing tied to a device). We previously used an API that generated a device‑related identifier, but its stability has changed on some Windows versions.

Before redesigning our approach, I want to understand which Microsoft‑supported APIs are recommended today for generating a stable and reliable per‑device identifier in UWP.

Specifically, I would like guidance on:

Whether SystemIdentification is the preferred API for this scenario

Whether identifiers derived from system‑provided firmware information are appropriate in UWP

Whether UWP apps should rely solely on publisher‑scoped identifiers or use a different model

I am not looking to circumvent platform restrictions—only for the officially supported guidance for UWP apps that need a stable device association mechanism.

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Jay Pham (WICLOUD CORPORATION) 3,415 Reputation points Microsoft External Staff Moderator
    2026-02-06T06:55:28.6866667+00:00

    Hi @Anjali Narvekar ,

    Thanks for reaching out.

    The currently recommended API is
    SystemIdentification.GetSystemIdForPublisher()
    from the Windows.System.Profile namespace.
    → Official method documentation: https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.systemidentification.getsystemidforpublisher

    This has emerged as the preferred choice:

    You should always check the .Source property to understand how trustworthy the ID is on that particular machine.

    Here’s a simple code sample:

    using Windows.System.Profile;
    using Windows.Security.Cryptography;
    
    var info = SystemIdentification.GetSystemIdForPublisher();
    
    if (info == null || info.Source == SystemIdentificationSource.None)
    {
        // Rare case — treat as new/unknown device
        return null;
    }
    
    string deviceId = CryptographicBuffer.EncodeToHexString(info.Id);
    // or: string deviceId = Convert.ToBase64String(info.Id.ToArray());
    
    string source = info.Source.ToString(); // "Tpm", "Uefi", or "Registry"
    
    // Typically send both deviceId + source to your server
    
    

    It’s far too sensitive to driver updates, CPU microcode patches, storage controller changes, etc.

    → HardwareIdentification class reference (notice the reduced recommendation): https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.hardwareidentification

    Give it a try on a few different machines (ones with TPM and some older ones without) and check what. values you’re getting. If anything looks unexpected (e.g., mostly falling back to Registry or IDs changing unexpectedly), just reply with more details (Windows build, device type, Source value) and I’ll help dig deeper.

    Hope this clears things up and gives you a solid path forward!

    1 person found this answer helpful.

  2. Anjali Narvekar 0 Reputation points
    2026-02-06T05:38:57.62+00:00

    Hi

    How can i trust the SystemIdentification API for my UWP app which is already in production for a long time with millions of users using it. Do you have any insights on any other public applications which are using this API.

     

    Also in case I decide to go ahead with this API, can you suggest which all windows OS hardware models and connected devices I need to test before rolling out in production

    0 comments No comments

  3. Q&A Assist
    2026-02-05T09:47:42.5933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    For generating a stable and reliable per-device identifier in UWP applications, you can consider the following Microsoft-supported APIs:

    1. SystemIdentification: This API is indeed a preferred option for generating device-related identifiers. It provides a unique system identifier based on the app publisher ID or user ID. You can use the GetSystemIdForPublisher method to obtain an identifier that is specific to the app publisher on the current device. This identifier is unique for each system and persists across restarts, reinstalls, and upgrades of Windows, making it suitable for licensing tied to a device.
    2. Identifiers from System Firmware: Identifiers derived from system-provided firmware information, such as those obtained from the Trusted Platform Module (TPM) or Unified Extensible Firmware Interface (UEFI), are appropriate in UWP. These identifiers are designed to be stable and can provide a reliable means of uniquely identifying a device.
    3. Publisher-Scoped Identifiers: UWP apps should consider using publisher-scoped identifiers as they ensure that the identifier is unique to the publisher across all users on that device. This approach helps maintain a consistent association between the app and the device, which is crucial for scenarios like licensing.

    In summary, using the SystemIdentification API along with identifiers from system firmware is a recommended approach for achieving a stable device association in UWP applications.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.