Find serial numbers on slaved HDDs with Powershell


  1. Posts : 10
    Windows 7 Enterprise 64 bit
       #1

    Find serial numbers on slaved HDDs with Powershell


    For starters, a little background. I am in the IT dept at my company, and we have a large number of HDD's that we need to archive. I have a powershell script that will grab hostname and username info from the drives, but I would like to grab the serial numbers as well if I can.

    Here's what I currently have that will grab the serial number info:

    $Disks = Get-WMIObject -class win32_PhysicalMedia
    foreach($Disk in $Disks) {Write-Host $Disk.SerialNumber}

    Ok, here's my question:
    This portion of the script works just fine, but it seems that the serial number field that stores this information is blank unless the PC was booted up with the HDD connected internally. I have close to 200-300 HDD's that I need to go through and we usually get a couple more every day, so it's not very feasible to reboot the computer for each drive (as opposed to using a USB HDD dock). Does anyone know if it's possible to have the computer re-scan the disks, or some other action that will cause this serial number field to populate, or will it only be populated when the drive is installed internally from boot-up?

    Thanks in advance for the help.
      My Computer


  2. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #2

    I'm not a cmd line person but you could try these two 3rd party program install on the mother computer. Then just plug in the usb drive and run the program.
    On my systems their is no reboot needed. Just plug them in the usb and run one of the programs.

    Speccy
    Belarc

    Belarc Advisor - Free Personal PC Audit, for software, hardware and security configuration information on your computer. Software license management, IT asset management, cyber security audits, and more.

    https://www.piriform.com/speccy

    From Belarc

    Drives 239.82 Gigabytes Usable Hard Drive Capacity
    182.38 Gigabytes Hard Drive Free Space

    CD-ROM Drive [Optical drive]

    INTEL SSDSC2BP240G4 [Hard drive] (240.06 GB) -- drive 0, s/n BTJR443200ZV240AGN, rev L2010420, SMART Status: Healthy
    Memorex TD Classic 003C USB Device [Hard drive] (2.05 GB) -- drive 1

    -----------------------------------------------------------------------------

    From Speccy

    torage
    Hard drives
    Disk drive
    Heads 16
    Cylinders 29,185
    Tracks 7,442,175
    Sectors 468,857,025
    SATA type SATA-III 6.0Gb/s
    Device type Fixed
    ATA Standard ATA8-ACS
    Serial Number BTJR443200ZV240AGN
    Firmware Version Number L2010420
    LBA Size 48-bit LBA
    Power On Count 327 times
    Power On Time 50.3 days
    Speed Not used (SSD Drive)
    Features S.M.A.R.T., NCQ, TRIM, SSD
    Max. Transfer Mode SATA III 6.0Gb/s
    Used Transfer Mode SATA III 6.0Gb/s
    Interface SATA
    Capacity 223 GB
    Real size 240,057,409,536 bytes
    RAID Type None
    S.M.A.R.T
    Status Good
    Temperature 21 °C
    Temperature Range OK (less than 50 °C)
    S.M.A.R.T attributes
    Partition 0
    Partition ID Disk #0, Partition #0
    Size 100 MB
    Partition 1
    Partition ID Disk #0, Partition #1
    Disk Letter C:
    File System NTFS
    Volume Serial Number 8A7DC2D0
    Size 223 GB
    Used Space 53 GB (23%)
    Free Space 169 GB (77%)
    Flash drives
    Memorex TD Classic 003C USB Device
    Interface USB
    Capacity 1.91 GB
    Real size 2,055,208,960 bytes
    RAID Type None
    S.M.A.R.T
    S.M.A.R.T not supported
    Partition 0
    Partition ID Disk #1, Partition #0
    Disk Letter E:
    File System FAT
    Volume Serial Number 60F0A925
    Size 1.91 GB
    Used Space 12.7 MB (0%)
    Free Space 1.9 GB (100%)
      My Computer


  3. Posts : 10
    Windows 7 Enterprise 64 bit
    Thread Starter
       #3

    Thanks for the tip, I'll keep that in mind. Ultimately, I would like to see if I can make it work within powershell though, as my powershell script gathers all the info, and then automatically prints it, so ultimately all I will need to do for each drive is connect it, and push F5.
      My Computer


  4. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #4

    I don't know enough about Powershell to be giving any advice.
    Just wait, someone will come along.
      My Computer


  5. Posts : 725
    Desk 1: Win 7 Pro x32; Desk 2: Windows 10 x64
       #5

    I don't know powershell either but here's another tool that might help. (It can also be run from command line and output to tab delimited file so you can extract the data you seek)

    Look at USBDeview freeware from Nirsoft to see serial numbers of USB connected disks. (Note the disks don't even need be still connected. Note the column header Connected tells you if the device is still connected or not)

    Click on column header Device Type to sort and then the scroll down to look at the USB Mass Storage (This device type also includes CD/DVD drives so you may still need to further filter the results if you only want disk)

    btw... What is the host name and user name of a hard drive???
    Attached Thumbnails Attached Thumbnails Find serial numbers on slaved HDDs with Powershell-2016-02-05_211147.jpg  
      My Computer


  6. Posts : 10
    Windows 7 Enterprise 64 bit
    Thread Starter
       #6

    ComputerGeek said:
    I don't know powershell either but here's another tool that might help. (It can also be run from command line and output to tab delimited file so you can extract the data you seek)

    Look at USBDeview freeware from Nirsoft to see serial numbers of USB connected disks. (Note the disks don't even need be still connected. Note the column header Connected tells you if the device is still connected or not)

    Click on column header Device Type to sort and then the scroll down to look at the USB Mass Storage (This device type also includes CD/DVD drives so you may still need to further filter the results if you only want disk)

    btw... What is the host name and user name of a hard drive???
    Thanks ComputerGeek, good info. I might look into USBDeview for it's command line options if I can't get it to work within powershell.

    I'm basically just gathering what the hostname was for any drives with a windows OS on them, as well as the users listed in C:\Users (or Docs and settings for XP drives). There will be some drives that don't have a windows OS on them, so those won't follow my normal process.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:50.
Find Us