I would like to use the smbios structure to get the UUID of all system types and not have to create a new property for each platform. But when I return a BinaryString value, I don’t see a way to display the expected string value.
Example This test was done on a windows system using the fixlet debugger v.9.0.835.0
Relevance:
if
exists smbios whose (exists structures whose ((name of it as lowercase is “system_information” as lowercase) and (exists values “uuid” of it)) of it)
then
values “uuid” of structures “system_information” of smbios
else
nothing
If you consider that a UUID is 128 bits (typically represented as 32 hex characters, but is represented as a 16 character string in your result), there is a way to parse the result in Windows to get what you want out of it. Taking the value you received and casting it to hexadecimal you will get all the hex characters of the UUID, just not in the same order you’re expecting.
In short - the first four bytes, the following 2 bytes, and the 2 bytes after that are all represented in little-endian byte encoding. If you flip each group around and add a couple of hyphens the end result will be the value you’re expecting:
Q: (first 2 of following text of position 6 of it & first 2 of following text of position 4 of it & first 2 of following text of position 2 of it & first 2 of following text of position 0 of it & “-” & first 2 of following text of position 10 of it & first 2 of following text of position 8 of it & “-” & first 2 of following text of position 14 of it & first 2 of following text of position 12 of it & “-” & first 4 of following text of position 16 of it & “-” & following text of position 20 of it) of concatenation “” of (it as hexadecimal) of “%80v%ade]%13%e3%11%afD%88Q%fbkP%84” as uppercase = “65AD7680-135D-11E3-AF44-8851FB6B5084”
A: True
Sourcing the UUID in Windows without WMI:
(first 2 of following text of position 6 of it & first 2 of following text of position 4 of it & first 2 of following text of position 2 of it & first 2 of following text of position 0 of it & “-” & first 2 of following text of position 10 of it & first 2 of following text of position 8 of it & “-” & first 2 of following text of position 14 of it & first 2 of following text of position 12 of it & “-” & first 4 of following text of position 16 of it & “-” & following text of position 20 of it) of concatenation “” of (it as hexadecimal) of characters of (value “uuid” of structures “system_information” of smbios as string) as uppercase
To get the UUID for a Mac you would use:
string “IOPlatformUUID” of dictionary of devicetree plane of iokit registry
I haven’t taken a look at this on the various *nix distributions yet, but if the smbios inspector doesn’t exist or doesn’t have the UUID I would think something exists under /dev on each platform that can be inspected… in the end you would simply have to take each platform’s relevance, wrap them in a collection of if-then-else statements and store it in one property.
Thank you!
That did the trick for all windows systems. I will have to manually check *nix systems tomorrow. The inspector doesn’t work for the AIX or Sun, do you have an idea on how I can retrieve the UUID from an AIX system through a property?
The local command would be something like this…
lsattr -El sys0 -a os_uuid -F value
Thanks for all the details this was a good addition to the RFC4122.