Created
October 5, 2021 00:04
-
-
Save nshores/519c7e1243725e98e4526d9ef0011342 to your computer and use it in GitHub Desktop.
vmdk_duptes.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://blog.milla-online.de/duplicate-disk-uuids-and-how-to-get-rid-of-it-hopefully | |
# get all hard disks | |
Write-Host "Get all hard disks... " -NoNewline | |
$alldisks = Get-VM | Get-HardDisk | |
Write-Host ("Found " + $alldisks.Count) | |
# filter disks for duplicate uuids and show the "disk.enableUUID" parameter | |
Write-Host "Filter for duplicate uuids... " -NoNewline | |
$diskswithduplicateuuids = $alldisks | Select-Object -Property Parent,Name,@{N="Disk-Uuid";E={$_.ExtensionData.Backing.Uuid}} | Group-Object -Property Disk-Uuid | Where-Object -FilterScript { $_.Count -ne 1 } | Select-Object -ExpandProperty Group | |
Write-Host ("Found " + $diskswithduplicateuuids.Count) | |
$diskswithduplicateuuids |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment