Reading BIOS AssetTag and Serial Number

Reading BIOS AssetTag and Serial Number

bios powershell windows script cmd

A few weeks ago I was paying with a PowerShell script to read some values from the BIOS. Here the key commands in case you need it.

Initially open a PowerShell console with Admin rights, then run the one of the following commands directly from the prompt.

For all the info in the object Win32_ComputerSystem:

$ComputerDetails = (Get-WmiObject -Class Win32_ComputerSystem)

It will save in the variable ComputerDetails an object with Domain, Manufacturer, Model, Name, PrimaryOwnerName and TotalPhysicalMemory.

If you want only get the model for example, you can get it with:

$ComputerModel = (Get-WmiObject -Class Win32_ComputerSystem).Model

The class Win32_BIOS contains BIOSVersion, Manufacturer, Name, SerialNumber and Version.

To check all details, run:

(Get-WmiObject -Class Win32_BIOS)

For only serial number:

$ComputerSerial = (Get-WmiObject -Class Win32_BIOS).SerialNumber

Another class that contains information for BIOS is Win32_SystemEnclosure, it have Manufacturer, Model, SerialNumer and SMBIOSAssetTag

For all details, check:

(Get-WmiObject -Class Win32_SystemEnclosure)

For serial number and asset tag:

$ComputerSerial = (Get-WmiObject -Class Win32_SystemEnclosure | Select-Object SerialNumber).SerialNumber
$ComputerAssetTag = (Get-WmiObject -Class Win32_SystemEnclosure | Select-Object SMBIOSAssetTag).SMBIOSAssetTag

Hope you find it useful
Have fun!

-G

Hope you find this useful, if you have any question please visit my twitter @bigg_pro and if you have a couple of pounds make a donation .

Add a comment

Previous Post Next Post