Month: December 2014

Serial Numbers Reprise (this time for hard drives)

Having to hack away at a strange request, getting the serial numbers for the hard drives installed on a system.

First, for the shell script for the Macs (tested on 10.8 and 10.9).
ioreg -c IOAHCIBlockStorageDevice | grep "Device Characteristics" | awk -F "Serial Number\"" '{print $2}' | awk -F "\"" '{print $2}'

Next for you windows folks, a quick one-two in the powershell.
wmic path win32_diskdrive get SerialNumber

’till next time.