iSMBIOS 1.1.8
dotnet add package iSMBIOS --version 1.1.8
NuGet\Install-Package iSMBIOS -Version 1.1.8
<PackageReference Include="iSMBIOS" Version="1.1.8" />
paket add iSMBIOS --version 1.1.8
#r "nuget: iSMBIOS, 1.1.8"
// Install iSMBIOS as a Cake Addin #addin nuget:?package=iSMBIOS&version=1.1.8 // Install iSMBIOS as a Cake Tool #tool nuget:?package=iSMBIOS&version=1.1.8
<p align="center">
<img src="https://cdn.rawgit.com/iAJTin/iSMBIOS/master/nuget/iSMBIOS.png"
height="32"/>
</p>
<p align="center">
<a href="https://github.com/iAJTin/iSMBIOS">
<img src="https://img.shields.io/badge/iTin-iSMBIOS-green.svg?style=flat"/>
</a>
</p>
What is iSMBIOS?
iSMBIOS is a lightweight implementation that allows us to obtain the SMBIOS information. Currently only works on Windows
This library implements DMTF Specification 3.7.0 version and olders versions
For more information, please see https://www.dmtf.org/standards/smbios
Install via NuGet
- From nuget gallery
<table>
<tr>
<td>
<a href="https://github.com/iAJTin/iSMBIOS">
<img src="https://img.shields.io/badge/-iSMBIOS-green.svg?style=flat"/>
</a>
</td>
<td>
<a href="https://www.nuget.org/packages/iSMBIOS/">
<img alt="NuGet Version"
src="https://img.shields.io/nuget/v/iSMBIOS.svg" />
</a>
</td>
</tr>
</table>
- From package manager console
PM> Install-Package iSMBIOS
Install via PowerShell
Now if you want you can use iSMBIOS from PowerShell. It has the iPowerShellSmbios module available that contains a collection of Cmdlets that allow us to obtain the SMBIOS information. If you want to know more, please review the available documentation from here.
- From PowerShellGallery
<table>
<tr>
<td>
<a href="https://github.com/iAJTin/iPowerShellSmbios">
<img src="https://img.shields.io/badge/-iPowerShellSmbios-green.svg?style=flat"/>
</a>
</td>
<td>
<a href="https://www.powershellgallery.com/packages/iPowerShellSmbios/">
<img alt="PowerShellGallery Version"
src="https://img.shields.io/powershellgallery/v/iPowerShellSmbios.svg?style=flat-square&label=iPowerShellSmbios" />
</a>
</td>
</tr>
</table>
- From PowerShell console
PM> Install-Module -Name iPowerShellSmbios
Usage
Before
Call DMI.Instance.Structures for getting all SMBIOS structures availables.
Now
The DMI.Instance property now is mark as obsolete use DMI.CreateInstance() method instead If you want to connect to a remote machine fill in an instance of the DmiConnectOptions object and use it as the argument of the DMI method.CreateInstance(optionsInstance).
For more info, please see CHANGELOG file.
Examples
Gets and prints SMBIOS version.
Console.WriteLine($@" SMBIOS Version > {DMI.CreateInstance().SmbiosVersion}");
Gets and prints all SMBIOS availables structures.
DmiStructureCollection structures = DMI.CreateInstance().Structures; foreach (DmiStructure structure in structures) { Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}"); int totalStructures = structure.Elements.Count; if (totalStructures > 1) { Console.WriteLine($@" > {totalStructures} structures"); } }
Gets and prints the implemented SMBIOS structure version.
DmiStructureCollection structures = DMI.CreateInstance().Structures; foreach (DmiStructure structure in structures) { Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}"); DmiClassCollection elements = structure.Elements; foreach (DmiClass element in elements) { Console.WriteLine($@" > Version > {element.ImplementedVersion}"); } }
Gets a single property directly.
DmiStructureCollection structures = DMI.CreateInstance().Structures; QueryPropertyResult biosVersion = structures.GetProperty(DmiProperty.Bios.BiosVersion); if (biosVersion.Success) { Console.WriteLine($@" > BIOS Version > {biosVersion.Result.Value}"); } QueryPropertyResult biosVendor = structures.GetProperty(DmiProperty.Bios.Vendor); if (biosVendor.Success) { Console.WriteLine($@" > BIOS Vendor > {biosVendor.Result.Value}"); } QueryPropertyResult currentSpeed = structures.GetProperty(DmiProperty.Processor.CurrentSpeed); if (currentSpeed.Success) { Console.WriteLine($@" > Current Speed > {currentSpeed.Result.Value} {currentSpeed.Result.Key.PropertyUnit}"); } QueryPropertyResult processorManufacturer = structures.GetProperty(DmiProperty.Processor.ProcessorManufacturer); if (processorManufacturer.Success) { Console.WriteLine($@" > Processor Manufacturer > {processorManufacturer.Result.Value}"); }
Gets a property in multiple elements directly (Handle result as collection).
// Requires that the Slot Information structure exists in your system DmiStructureCollection structures = DMI.CreateInstance().Structures; QueryPropertyCollectionResult systemSlotsQueryResult = structures.GetProperties(DmiProperty.SystemSlots.SlotDesignation); if (!systemSlotsQueryResult.Success) { Console.WriteLine($@" > Error(s)"); Console.WriteLine($@" {systemSlotsQueryResult.Errors.AsMessages().ToStringBuilder()}"); } else { IEnumerable<PropertyItem> systemSlotsItems = systemSlotsQueryResult.Result.ToList(); bool hasSystemSlotsItems = systemSlotsItems.Any(); if (!hasSystemSlotsItems) { Console.WriteLine($@" > Sorry, The '{DmiProperty.SystemSlots.SlotId}' property has not implemented on this system"); } else { int index = 0; foreach (var systemSlotItem in systemSlotsItems) { Console.WriteLine($@" > System Slot ({index}) > {systemSlotItem.Value}"); index++; } } }
Gets a property in multiple elements directly (Handle result as dictionary).
// Requires that the Slot Information structure exists in your system DmiStructureCollection structures = DMI.CreateInstance().Structures; QueryPropertyCollectionResult systemSlotsQueryResult = structures.GetProperties(DmiProperty.SystemSlots.SlotDesignation); var systemSlotsQueryDictionayResult = systemSlotsQueryResult.AsDictionaryResult(); if (!systemSlotsQueryDictionayResult.Success) { Console.WriteLine($@" > Error(s)"); Console.WriteLine($@" {systemSlotsQueryDictionayResult.Errors.AsMessages().ToStringBuilder()}"); } else { var systemSlotsItems = systemSlotsQueryDictionayResult.Result.ToList(); bool hasSystemSlotsItems = systemSlotsItems.Any(); if (!hasSystemSlotsItems) { Console.WriteLine($@" > Sorry, The '{DmiProperty.SystemSlots.SlotId}' property has not implemented on this system"); } else { foreach (var systemSlotItemEntry in systemSlotsItems) { var itemIndex = systemSlotItemEntry.Key; var itemValue = systemSlotItemEntry.Value; Console.WriteLine($@" > System Slot ({itemIndex}) > {itemValue.Value}"); } } }
Prints all SMBIOS structures properties
DmiStructureCollection structures = DMI.CreateInstance().Structures; foreach (DmiStructure structure in structures) { DmiClassCollection elements = structure.Elements; foreach (DmiClass element in elements) { Console.WriteLine(); Console.WriteLine(element.ImplementedVersion == DmiStructureVersion.Latest ? $@" ———————————————————————————————————————————————————— {element.ImplementedVersion} ——" : $@" ——————————————————————————————————————————————————————— {element.ImplementedVersion} ——"); Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName} structure detail"); Console.WriteLine(@" ——————————————————————————————————————————————————————————————"); IEnumerable<IPropertyKey> properties = element.ImplementedProperties; foreach (var property in properties) { QueryPropertyResult queryResult = element.GetProperty(property); PropertyItem propertyItem = queryResult.Result; object value = propertyItem.Value; string friendlyName = property.GetPropertyName(); PropertyUnit valueUnit = property.PropertyUnit; string unit = valueUnit == PropertyUnit.None ? string.Empty : valueUnit.ToString(); if (value == null) { Console.WriteLine($@" > {friendlyName} > NULL"); continue; } if (value is string) { Console.WriteLine($@" > {friendlyName} > {value} {unit}"); } else if (value is byte) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X2}h]"); } else if (value is short) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]"); } else if (value is ushort) { Console.WriteLine(property.Equals(DmiProperty.MemoryDevice.ConfiguredMemoryClockSpeed) ? $@" > {friendlyName} > {value} {(int.Parse(dmi.SmbiosVersion) > 300 ? PropertyUnit.MTs : PropertyUnit.MHz)} [{value:X4}h]" : $@" > {friendlyName} > {value} {unit} [{value:X4}h]"); } else if (value is int) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]"); } else if (value is uint) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]"); } else if (value is long) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]"); } else if (value is ulong) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]"); } else if (value.GetType() == typeof(ReadOnlyCollection<byte>)) { Console.WriteLine($@" > {friendlyName} > {string.Join(", ", (ReadOnlyCollection<byte>)value)}"); } else if (value is DmiGroupAssociationElementCollection) { // prints elements } else if (value.GetType() == typeof(ReadOnlyCollection<string>)) { Console.WriteLine($@" > {friendlyName}"); var collection = (ReadOnlyCollection<string>)value; foreach (var entry in collection) { Console.WriteLine($@" > {entry} {unit}"); } } else { Console.WriteLine($@" > {friendlyName} > {value} {unit}"); } } } }
Documentation
- For full code documentation, please see next link documentation.
How can I send feedback!!!
If you have found iSMBIOS useful at work or in a personal project, I would love to hear about it. If you have decided not to use iSMBIOS, please send me and email stating why this is so. I will use this feedback to improve iSMBIOS in future releases.
My email address is
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Management (>= 6.0.0)
-
.NETStandard 2.1
- System.Management (>= 6.0.0)
-
net6.0
- System.Management (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.8 | 3,574 | 8/17/2023 |
1.1.7 | 3,990 | 9/29/2022 |
1.1.6 | 3,345 | 12/9/2021 |
1.1.5 | 4,566 | 10/12/2020 |
1.1.4 | 1,283 | 8/25/2020 |
1.1.3 | 2,672 | 3/6/2020 |
1.1.2 | 558 | 2/15/2020 |
1.1.1 | 3,290 | 10/20/2019 |
1.1.0 | 592 | 9/2/2019 |
1.0.9 | 538 | 8/28/2019 |
1.0.8 | 563 | 8/23/2019 |
1.0.7 | 567 | 8/13/2019 |
1.0.6 | 624 | 5/29/2019 |
1.0.5 | 635 | 4/25/2019 |
1.0.3 | 580 | 4/12/2019 |
1.0.2 | 558 | 4/2/2019 |
1.0.1 | 632 | 3/22/2019 |
1.0.0 | 1,318 | 12/29/2018 |