Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for querying BIOS version #1

Open
franklesniak opened this issue Jun 30, 2021 · 8 comments
Open

Add support for querying BIOS version #1

franklesniak opened this issue Jun 30, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@franklesniak
Copy link
Owner

It'd be great if SAA could query BIOS version information.

In Windows, the best way to do this seems to be:
Win32_BIOS -> smbiosbiosversion
and some people say Win32_BIOS -> releasedate is more reliable

There are other properties of interest, too:
biosversion (more of a display name, returns multiple strings in an array)
smbiosmajorversion (not sure how useful this is)
smbiosminorversion (not sure how useful this is)

@franklesniak franklesniak added the enhancement New feature or request label Jun 30, 2021
@franklesniak franklesniak self-assigned this Jun 30, 2021
@franklesniak
Copy link
Owner Author

Posting for future reference - there is an interesting difference between the WMI cmdlets (which behave more like VBScript), and the Get-CimInstance cmdlets.
image

@franklesniak
Copy link
Owner Author

More legacy PowerShell stuff for future reference:
image

@franklesniak
Copy link
Owner Author

franklesniak commented Jul 2, 2021

Might be useful to convert WMI UTC string date format to native VBScript: https://www.informit.com/articles/article.aspx?p=23751&seqNum=3

This Microsoft doc is good for converting CIM_DATE format to VT_DATE (native VBScript date/time format)
https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemdatetime#examples

However, the note on this SE post indicates that the WbemScripting.SWbemDateTime object is not available on older operating systems:
https://stackoverflow.com/a/29537092/2134110
and I confirmed this in the MSDN 2003 library --- SWbemDateTime was first available in Windows XP and Windows Server 2003. So older OSes won't have it and will instead need to be parsed as mentioned in the informit.com article linked above.

@franklesniak
Copy link
Owner Author

franklesniak commented Jul 2, 2021

The yyyyMMddHHmmss format comes from the Distributed Management Task Force (DMTF)'s Common Information Model (CIM) specification. See: https://docs.microsoft.com/en-us/windows/win32/wmisdk/date-and-time-format

WMI puts strings in this format to comply with the standard.

However, SMBIOS uses a different standard, also published by the DMTF. The SMBIOS standard says that the release date must be a string in the format "MM/DD/YYYY" or "MM/DD/YY" for a BIOS released 1999 or prior. Source: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0.pdf

@franklesniak
Copy link
Owner Author

How to get BIOS information on Linux:
https://stackoverflow.com/a/20604726/2134110

Also:
https://wiki.ubuntu.com/DellBIOS

Both sources confirmed that SMBIOSBIOSVersion/bios-version and ReleaseDate/bios-release-date are the most important data points. Manufacturer/bios-vendor is also useful.

@franklesniak
Copy link
Owner Author

franklesniak commented Jul 6, 2021

This post seems to suggest ISO 2601 format for string-based date output: https://stackoverflow.com/a/49562607/2134110

So maybe the move is to convert the DMTF date to ISO 2601 format for string output, and then DMTF to native VBScript/PowerShell datetime format

This SE post is pretty good reference for converting .NET datetime to ISO 2601. https://stackoverflow.com/questions/114983/given-a-datetime-object-how-do-i-get-an-iso-8601-date-in-string-format

@franklesniak
Copy link
Owner Author

This is a useful function to determine whether a given date falls into DST:
https://www.robvanderwoude.com/files/isdst_vbs.txt
It requires Windows NT4 SP4 (or later), Windows 2000, or later

@franklesniak
Copy link
Owner Author

Leaving open until PowerShell code is written

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant