A Dell service tag is the BIOS serial number, so the quickest way to get the Dell service tag using PowerShell is one CIM query. It works in Windows PowerShell 5.1 and PowerShell 7:
(Get-CimInstance -ClassName Win32_BIOS).SerialNumber
In this guide, I’ll show you how to get the Dell service tag using PowerShell on your own PC, why Dell’s GWMI command breaks in PowerShell 7, and how to collect tags from remote computers into a CSV file.
My test PC isn’t a Dell, and its serial is private, so you’ll see it masked as XXXXXXXXXX in every output and screenshot.
Get the Dell service tag with Get-CimInstance
Win32_BIOS exposes the serial number Dell writes into the firmware. Select the property to see it as a small table:
Get-CimInstance -ClassName Win32_BIOS | Select-Object SerialNumber
Output:
SerialNumber
------------
XXXXXXXXXX
When you want just the text, read the property directly. The same value also lives in Win32_SystemEnclosure, which some admins prefer:
$bios = (Get-CimInstance -ClassName Win32_BIOS).SerialNumber
$case = (Get-CimInstance -ClassName Win32_SystemEnclosure).SerialNumber
"Service tag: $bios"
"Same in Win32_SystemEnclosure: $($bios -eq $case)"
Output:
Service tag: XXXXXXXXXX
Same in Win32_SystemEnclosure: True

Both classes returned the same value on my PC. If you need more BIOS fields, like the version and release date, see getting BIOS information with PowerShell.
Why does Dell’s GWMI command fail in PowerShell 7?
Dell’s support article tells you to run GWMI -Class Win32_Bios | select SerialNumber. In Windows PowerShell 5.1, it still works:
GWMI -Class Win32_Bios | select SerialNumber
Output:
SerialNumber
------------
XXXXXXXXXX

Run the exact same line in PowerShell 7 and you get a CommandNotFound error, because the gwmi alias and Get-WmiObject were removed from PowerShell 7:

Get-CimInstance works natively in both versions, so it’s the one to put in scripts. If you’d rather trap errors like this one, wrap the call in a PowerShell try/catch block.
Is WMIC still available on Windows 11?
Older guides use wmic bios get serialnumber. Microsoft deprecated WMIC in Windows 10 21H1, and it’s now removed on Windows 11 24H2 and later. Here’s a quick check:
"WMIC available: $([bool](Get-Command wmic.exe -ErrorAction SilentlyContinue))"
Output:
WMIC available: False
It returned False in both shells on my Windows 11 PC. WMI itself isn’t affected, so the CIM cmdlets keep working.
Get-ComputerInfo: BiosSerialNumber vs BiosSeralNumber
Get-ComputerInfo also returns the serial, but the property name depends on your PowerShell version. This lists the matching property:
$info = Get-ComputerInfo
$info.PSObject.Properties.Name -like 'Bios*Ser*'
Output (PowerShell 7):
BiosSerialNumber
BiosSeralNumber
That second line is from Windows PowerShell 5.1, where the property is misspelled BiosSeralNumber. PowerShell 7 fixed it to BiosSerialNumber, so a script that reads one name gets nothing in the other shell.

Get-ComputerInfo is also slow, since it collects dozens of values. Stick with Win32_BIOS when you only need the tag.
How do I get the service tag of a remote computer?
Pass one or more names to -ComputerName. It connects over WinRM, so the remote PC needs PowerShell remoting enabled:
Get-CimInstance -ClassName Win32_BIOS -ComputerName DEN-LT-014, AUS-WS-201 |
Select-Object PSComputerName, SerialNumber
I don’t have a Dell fleet here, so that one is code only. For a list in a text file, use -ComputerName (Get-Content .\computers.txt).
If WinRM isn’t running, you’ll get a WS-Management error. A DCOM session still works, and I tested it against my own PC:
$opt = New-CimSessionOption -Protocol Dcom
$s = New-CimSession -ComputerName localhost -SessionOption $opt
Get-CimInstance -ClassName Win32_BIOS -CimSession $s |
Select-Object PSComputerName, SerialNumber
Remove-CimSession $s
Output:
PSComputerName SerialNumber
-------------- ------------
localhost XXXXXXXXXX
DCOM needs the firewall to allow remote WMI on the target. Finding the right machine names first? Here’s how to get the computer name in PowerShell.
A reusable function that skips non-Dell PCs
A serial number from an HP or Lenovo isn’t a Dell service tag. This function checks Win32_ComputerSystem first and only returns a tag for Dell machines: