For years I've been using the drive serial number to map virtualized guest disks to the hyper-visor disk. VMWare ESXi for instance will set the disk serial number to the UUID of the disk - allows for easy mapping.
Now that I've got a few Windows Server 2019 servers running I've noticed that none of them are returning the disk Serial Number through the following WMI classes: Win32_DiskDrive
, Win32_PhysicalMedia
.
I've gone through the documentation for Windows and the WMI classes that I am using but can find no reference to it being deprecated/removed.
How might I get the disk (not the volume) serial number in Windows 2019 using .NET?
This issue occurs when the script is unable to read the disk UUID or Serial Number value for one or more virtual machine disks.
If the VM is not created with vSphere WebClient, the advanced parameter disk.EnableUUID
is not set.
To workaround this issue, set the disk.EnableUUID
variable to true.
To configure disk.EnableUUID
using the vSphere Web Client:
disk.EnableUUID
.TRUE
.Reference: Vmware KB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With