Disk Unique ID

Hi, 

 

Is there is any way i can get the disk unique ID as shown below with powershell & WMI

 

DISKPART> detail disk

 

XXXXXXXXX SCSI Disk Device

Disk ID: {XXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

Type   : SATA

Parents
No Data
Reply
  • You should be able to retrieve it, and some other info you might find useful, with a powershell commandlet. Something like

    $ Get-Disk | Select DiskNumber, BusType, PartitionStyle, Guid, Signature

    Here the "Guid" property will retrieve the Disk GUID for a GPT formated disk, which is what diskpart shows you as the uniqueid.

    For an MBR formated disk, it will retrieve the Signature (as a decimal value). This also matches what diskpart reports, albeit in hex, as the uniqueid for that type of disk.

Children
No Data