Getting Dell Service Tag using PowerShell

by Bharat Suneja

A popular script on this blog uses the Win32_SystemEnclosure WMI class to get the Dell Service Tag from Dell computers [read previous post “Getting Dell Service Tag using WMI“.

Powershell’s get-wmiobject commandlet makes it a one-liner:

Get-WmiObject win32_SystemEnclosure | select serialnumber

To list all properties exposed by the Win32_SystemEnclosure class:

Get-WmiObject win32_SystemEnclosure | fl *

{ 9 comments… read them below or add one }

Ronald February 12, 2007 at 1:39 pm

Seems like the following works too:

Get-WMIObject -Class Win32_Bios

Added advantage is it works on my IBM Blades too whereas the other does not…


Anonymous November 24, 2008 at 9:07 am

gwmi win32_bios

works too


cheap computers October 21, 2009 at 2:30 am

Dell has been remarkably open to date in allowing users to publicly vent their spleen on its blog.


Albert Widjaja March 6, 2011 at 11:36 pm

Does this also works for HP Server ?


Mark May 23, 2012 at 2:22 pm

So how do you get the serial without all of the extra text. I have thus far:

gwmi win32_bios | select serialnumber

But that returns:

[The actual serial number]

How can I omit the first two lines being returned?


EvilEmuOfDoom June 4, 2012 at 7:40 am

“How can I omit the first two lines being returned?”

You want to use the “-expand” flag for Select-Object. Try this:
gwmi win32_bios | select -expand serialnumber


Robert September 24, 2012 at 1:37 pm

How can you get the service tags for multiple servers at the same time?


Nathan October 23, 2012 at 1:59 pm

gwmi win32_bios -computer servername | select -expand serialnumber


Ripstone February 8, 2022 at 6:16 am

WMI has been deprecated since PowerShell v3. This command should work going forward:

Get-CimInstance win32_SystemEnclosure | select serialnumber


Leave a Comment

Previous post:

Next post: