How to set a serial number for a guest VM

Apr 19, 2022
3
1
3
Hello,

I would like to use a guest VM with Microsoft Intune for testing.
But in order to do this I need to import the VM into Intune and the VM must have a serial number.
I have looked on many forums and the only info I could find was a post where it was said to enter "UUID != serial" in Options/SMBios
When I tried that it literally set the serial number to that string.

My VM is running OVMF
And PROXMOX 7.1-11

Could someone please help with some advice on how I could set a serial number for a guest VM ?

Thanks in advance
 
Hi Leesteken,
Thanks for your reply.
That is the field I have been using.
if I enter a string such as SMC1026 in the serial field then fire up the VM.
when I query WMI ( Windows 10) the serial number field is empty.
however when I entered UUID=SMC1026 in the SMBIOS serial field,
I could see that exact string with a WMI query on the VM.
 
I'm not familiar with WMI,but when I set the Serial field to SMC1026 and use wmic bios get serialnumer in a Windows 10 VM it show thiss:
SerialNumber SMC1026
It looks like smbios1: serial=U01DMTAyNg==,base64=1 In the VM configuration file.
Am I doing it wrong or did I misunderstand your explanation?
 
I don’t believe this
I just entered a new value into the SMBIOS serial field,
shutdown, and started the VM when I checked WMI-BIOS-Serial the new value is there
I swear I did that many times a few days ago !!!

Big thanks Leesteken
 
  • Like
Reactions: leesteken
Hi. How can I set baseboard Serial number ?
I have tried what you guys have offered and the BIOS SN is showing fine with
wmic bios get serialnumber
but baseboard with the
wmic baseboard get serialnumber
return a message which says: No Instance(s) Available
Here :
Screenshot_20240612_092204.pngScreenshot_20240612_092316.png

I would be much appreciated for your help
 
A little late to this, but Microsoft is hosting a nice PowerShell script to get the SMBios settings over at https://learn.microsoft.com/en-us/w...ple-powershell-script-to-query-smbios-locally.

And here's a copy in case the link dies sometime in the future.
code_language.shell:
# Set-ExecutionPolicy or Script Signing documentation needs to be reviewed
# Current script is designed to run on individual machines
#

#
$ChassisTypes =
@{
    1='Other'
    2='Unknown'
    3='Desktop'
    4='Low Profile Desktop'
    5='Pizza Box'
    6='Mini Tower'
    7='Tower'
    8='Portable'
    9='Laptop'
    10='Notebook'
    11='Hand Held'
    12='Docking Station'
    13='All in One'
    14='Sub Notebook'
    15='Space-Saving'
    16='Lunch Box'
    17='Main System Chassis'
    18='Expansion Chassis'
    19='SubChassis'
    20='Bus Expansion Chassis'
    21='Peripheral Chassis'
    22='Storage Chassis'
    23='Rack Mount Chassis'
    24='Sealed-Case PC'
    25='Multi-system chassis'
    26='Compact PCI'
    27='Advanced TCA'
    28='Blade'
    29='Blade Enclosure'
    30='Tablet'
    31='Convertible'
    32='Detachable'
    33='IoT Gateway'
    34='Embedded PC'
    35='Mini PC'
    36='Stick PC'
}

$namespace = "root\CIMV2"

$machines = New-Object System.Collections.ArrayList

# TODO: add code to populate the machine list from user input, etc.
#
$machines.Add("LocalHost") | Out-Null

$list = New-Object System.Collections.ArrayList

foreach ($machine in $machines)
{
    $obj = New-Object -Type PSObject | Select-Object SerialNumber, Manufacturer, UUID, BaseBoardProduct, ChassisTypes, Chassis, SystemFamily, SystemSKUNumber

    $obj.SerialNumber = Get-WmiObject -class Win32_Bios -computername $machine -namespace $namespace | Select-Object -ExpandProperty SerialNumber
    $obj.Manufacturer = Get-WmiObject -class Win32_Bios -computername $machine -namespace $namespace | Select-Object -ExpandProperty Manufacturer
    $obj.UUID = Get-WmiObject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID
    $obj.BaseBoardProduct = Get-WmiObject Win32_BaseBoard | Select-Object -ExpandProperty Product
    $obj.ChassisTypes = Get-WmiObject Win32_SystemEnclosure | Select-Object -ExpandProperty ChassisTypes
    $obj.Chassis = $ChassisTypes[[int]$obj.ChassisTypes]
    $obj.SystemFamily = Get-WmiObject Win32_ComputerSystem | Select-Object -ExpandProperty SystemFamily
    $obj.SystemSKUNumber = Get-WmiObject Win32_ComputerSystem | Select-Object -ExpandProperty SystemSKUNumber

    $list.Add($obj) | Out-Null
}

# TODO: add code to handle output (save to local file, upload to share, etc.)
#
# to use on single line for each object
# $list | Sort-Object Manufacturer, Chassis | Format-Table Manufacturer, ChassisTypes, Chassis, SystemFamily, BaseBoard_Product, SerialNumber, UUID, SystemSKUNumber -Wrap

# Optional: pipe to Excel:
# $list | Export-Csv c:\path\filename.csv -Encoding Unicode -NoTypeInformation
#
# Optional: pipe to UI
# $list | Out-GridView
#
$list

Results in a table like this (redacted):
Code:
SerialNumber     : PC123ABC
Manufacturer     : LENOVO
UUID             : ABC123AA-AAAA-BBBB-5555-111111111111
BaseBoardProduct : 20ABABABAB
ChassisTypes     : 10
Chassis          : Notebook
SystemFamily     : ThinkPad T14s Gen 2i
SystemSKUNumber  : LENOVO_AA_AAAA_AA_AAAAA_AA_ThinkPad T14s Gen 2i