Powershell Logo

Reset Disk Identifiers

Todays post will show you how to reset disk identifiers for Hyper-V, this will come in handy when cloning your VHD(X) files 👍

The issue:

You have a VHD or VHDX file that you have sysprepped and you would like to use this disk over and over in the same environment but you keep getting error “DISK has the same disk identifiers as one or more disks connected to the system”.

Reset Disk Identifiers

To my knowledge this doesnt cause any specific issues as such, but our monitoring software that trawls the error log picked this up as Windows cant tell the difference when using the same sysprepped file as the VHD/VHDX keeps its unique GUID.

The resolution:

Another nice and easy one that can be fixed with Powershell:

Frist we would use the get command to see what the current Identifier is:

Get-vhd -path “path of your disk\nameofyourdisk.vhdx”Reset Disk Identifers

As we can see the DiskIdentifier is shown above. Now we know what the before is we can check the after to make sure our command works:

Set-vhd -path “path of your disk\nameofyourdisk.vhdx” -Resetdiskidentifier

*Please note this can only be ran with the VM powered off*

Reset Disk Identifers


Confirm the command and rerun the get command again to make sure the changes have taken effect.

Reset Disk Identifers

As you can see the disk now has a new unique identifier 👍

You can see Microsofts official word on it here

If you have any questions on this topic or anything else, please feel free to get in touch 👍

Leave a Reply