question

WillieMalveaux-0155 avatar image
0 Votes"
WillieMalveaux-0155 asked BhanuEjjagiri-MSFT commented

How to set Hard Disk Serial Number Azure

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-machineswindows-hardwarewindows-10-hyperv
hard-disk.png (9.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BhanuEjjagiri-MSFT avatar image
0 Votes"
BhanuEjjagiri-MSFT answered BhanuEjjagiri-MSFT commented

Hi @WillieMalveaux-0155
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][1]

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][2]

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

I am hoping this answers your questions, please market the same as an answer if helps else let me know your further queries.
[1]: /answers/storage/attachments/155725-no-serialnum.png
[2]: /answers/storage/attachments/155744-msinfo32.png
[3]: /answers/storage/attachments/155705-vol.png


no-serialnum.png (35.4 KiB)
msinfo32.png (53.5 KiB)
vol.png (19.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Virtualbox emulates this somehow though, so I was wondering how that virtual machine does it. The volume serial number is completely useless to me, as I wanted some binding number I could use that cannot be shifted or spoofed. Prior to recent windows updates I was using the windows key.

0 Votes 0 ·

Hi @WillieMalveaux-0155
Sorry for the inconvenience, this is a design limitation and there is no graceful option to get the disk serial number apart from the ways that I provided above.

I request you to kindly share this idea here # https://feedback.azure.com/ to bring it to our Azure developers notice.

Thanks!

0 Votes 0 ·