PowerShell two liner to determine LUN IDs and match them up with disks in Disk Management in Windows Server 2012 R2

When there’re only a few LUNs or all LUNs are of a different size, it’s too easy to tell what LUNs what disk in disk management. Problem arises when LUNs are the same size or there are multiple LUNs/cluster. Here’s a quick 2 liner to find this out. Keep in mind, in my environment I have SCVMM 2012 R2 and the following command makes use of the SCVMM module for PowerShell.

$host = Get-SCVMHost -ComputerName hyper01.domain.local
$host.Disks | ft Name,ClusterDisk,DiskStatus,SMLunId -AutoSize

There you have it. Just run $host.Disks to see what other properties you can play with. You can also output to file using the Out-File cmdlet.

Leave a Comment

Your email address will not be published.