How to set Hard Disk Serial Number Azure

Willie Malveaux 1 Reputation point
2021-12-07T18:01:17.9+00:00

Hello,

I am a developer working on an application that uses the hard disk serial number to generate a key. When I run the command "wmic diskdrive get Name, Manufacturer, Model, InterfaceType, MediaType, SerialNumber" I notice that the serial number is blank. Is there any way to set the serial number? Are there any future plans for this?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
6,839 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,473 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,510 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 45,091 Reputation points
    2021-12-07T18:36:34.187+00:00

    If you're referring to the volume ID that is set when the drive is formatted then yes you can change it.

    Download the SysInternals VolumeID tool here.
    Run the tool as an admin and set the ID to what you want (ensuring it follows the format needed).
    Reboot.

    Note that long term it might be better to adjust your app to allow you to set the key in a different manner. Then again if you're running this in Azure and it is your app then why would you need a key to begin with.

    0 comments No comments

  2. Bhanu Ejjagiri 256 Reputation points Microsoft Employee
    2021-12-07T18:56:25.46+00:00

    Hi @Willie Malveaux
    Generally, you can use “wmic diskdrive get serialnumber” in the Command prompt to retrieve Seral Number of a Physical media.
    But it doesn’t works for Virtual Disks.

    Example output:
    155725-no-serialnum.png

    However you can still retrieve Volume GUID/Serial of the VHD(pls see below)
    In the “Search” field type “System information” or open run prompt and type "msinfo32" and expand "Components --> Storage --> and Drives"
    155744-msinfo32.png

    Or
    Open command prompt. Type “Vol” and press enter.
    155705-vol.png

    I am hoping this answers your questions, please market the same as an answer if helps else let me know your further queries.