How to get the Motherboard Serial in C# and VB.NET

To get the Motherboard Serial in C# and VB.NET you can use the following snippet.

Sample C#

var managementObjectSearcher = new ManagementObjectSearcher("Select * From Win32_BaseBoard");
foreach (var managementObject in managementObjectSearcher.Get())
{
	Console.WriteLine(managementObject["SerialNumber"].ToString());
}

Sample VB.NET

Dim managementObjectSearcher = New ManagementObjectSearcher("Select * From Win32_BaseBoard")
For Each managementObject As var In managementObjectSearcher.Get()
	Console.WriteLine(managementObject("SerialNumber").ToString())
Next

some mainboard manufacturers do not add this information, you will then geht something like

Not Applicable

Please Share us:
Please rate this snippet

One thought on “How to get the Motherboard Serial in C# and VB.NET

Leave a Reply