What is the equivalent of the vol command?

42 views
Skip to first unread message

Kurt Buff - GSEC, GCIH

unread,
Apr 3, 2020, 7:42:25 PM4/3/20
to ntpowe...@googlegroups.com
with cmd.exe
      C:\Users\Kurt.Buff>vol c:
      Volume in drive C has no label.
      Volume Serial Number is 82DF-365D

With PowerShell, I can't seem to find the Volume Serial Number with get-disk, get-physicaldisk or get-volume, or even get-wmi, though I'll admit that I don't know nearly enough about that last cmdlet.

This isn't crucial, but most of the monitoring solutions out there use the volume serial number to identify/differentiate the disks, and I just got curious on how to pull that with PowerShell.


Kurt


Andrea 'ML' Suatoni

unread,
Apr 3, 2020, 7:52:47 PM4/3/20
to ntpowe...@googlegroups.com

Get-WmiObject Win32_LogicalDisk | Format-Table Name, VolumeSerialNumber

 

Gives you a list of all the logical disks and their serial numbers, where applicable and without the separating dash.

 

Andrea

 

--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntpowershell...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntpowershell/CADy1Ce7hFO00OP0LjjqHL1Q_uD1qMf%3DbAEejJDj34wh-k2Z5mA%40mail.gmail.com.

Kurt Buff - GSEC, GCIH

unread,
Apr 3, 2020, 8:30:46 PM4/3/20
to ntpowe...@googlegroups.com
OK - that's weird.

That worked on my personal machine at home this very moment, but the VolumeSerialNumber field was empty on a machine at work when I tried that.

I'm going to try that again at work tomorrow (yes, I'm working all day on Saturday) and see if I typo'ed or if I've run into something weird about my work machine.

Thanks,

Kurt

Kurt Buff - GSEC, GCIH

unread,
Apr 4, 2020, 10:42:34 AM4/4/20
to ntpowe...@googlegroups.com
Thanks -That worked - I must have been fatfingering something earlier.

Kurt

On Fri, Apr 3, 2020 at 5:52 PM Andrea 'ML' Suatoni <notsohid...@outlook.com> wrote:
Reply all
Reply to author
Forward
0 new messages