I have been asked this question more than I have fingers and toes so I figured I would do a quick post providing the Windows PowerShell that will retrieve the Serial Number for any LUN connected to a Windows Server.
1 2 3 4 5 6 7 8 9 10 11 |
$AllDevices = gwmi –Class Win32_DiskDrive –Namespace ‘rootCIMV2’ ForEach ($Device in $AllDevices) { if($Device.Model –like ‘PURE FlashArray*’) { @{ Name=$Device.Name; Caption=$Device.Caption; Index=$Device.Index; SerialNo=$Device.SerialNumber; } | Format–Table –AutoSize } } |
The Index corresponds to what the Windows Disk Management displays. Now there is a 1:1 mapping of Device Index and Serial Number that can be used for automation tasks.
Download FlashBlade
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Name Value —— ——– Caption PURE FlashArray Multi–Path Disk Device Name .PHYSICALDRIVE0 SerialNo 73E940225A2A52BB0003AE86 Index 0 Name Value —— ——– Caption PURE FlashArray Multi–Path Disk Device Name .PHYSICALDRIVE3 SerialNo 45084F3508BF46140001192C Index 3 |
Thanks,
Barkz