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.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s