How to output the "ID(computer id)" to text file or registry in own pc

I want to out put the “ID(computer id)” to text file or registry in own pc.
I hope that I cooperate with other system using this ID value.
But I don’t know the way. Please teach me.

I know that this ID is saved in registry. But the value is Hexadecimal.
So the value don’t match the value of ID on console.

ex)

  1. output to registry
    action script : setting “BigFixID”= ******* on “{now}” for client

2)output to text file

3)Other way

You could use this to write the ID to a registry value

regset "[HKEY_LOCAL_MACHINE\SOFTWARE\MyKey]" "ID"="{computer id}"

Or how about converting the existing hexadecimal value from the registry?

Q: hexadecimal integer (concatenation of characters (14;15;12;13;10;11;8;9;6;7;4;5;2;3;0;1) of (value "ComputerID" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions" of registry as string))
A: 11698628
T: 0.298 ms
I: singular integer
2 Likes

Dear SLB,

Thank you for your answer. My question has been resolved.

Sorry to necro this 2 year old thread, but I wanted to build on your technique @SLB
I like how you did your byte swapping for the endian issue in the reg key, but I was wondering if there was a more general solution for byte swapping unknown length?

How could I generate the (14;15;12;13;10;11;8;9;6;7;4;5;2;3;0;1) automatically?

I took a trick from this post 2006 post: Reversing order of substrings
modified it to this:

(it;it+1) of lengths of following texts of positions whose (it mod 2 = 0 and it != 0)

And replaced the hand crafted plural integer.

q: hexadecimal integer (concatenation of characters((it;it+1) of lengths of following texts of positions whose (it mod 2 = 0 and it != 0) of it) of (value "ComputerID" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions" of registry as string))
A: 3901791
I: singular integer
6 Likes

What a brilliant solution to byte swapping for variable lengths. Nice one @brolly33

1 Like

Here in 2022, I’m replying to @brolly33’s answer because it answers something I was working on just now. To help surface future searches:

On Windows, the BigFix client stores its computer id as value “ComputerID” of “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions”. The value type is REG_BINARY. The stored value is equivalent to: (computer id as hexadecimal)

This solution is perfect for, say, backsolving the registry entry to the original computer id.

Q: computer id = (hexadecimal integer (concatenation of characters((it;it+1) of lengths of following texts of positions whose (it mod 2 = 0 and it != 0) of it) of (value "ComputerID" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions" of registry as string)))
A: True
2 Likes

@aram, here’s how we’d correlate Tenable’s plugin 55817 output back to computerId. :smiley:

2 Likes

Here in 2023, I used SLB’s method with substrings before I scrolled down and seen your method is even better than mine.

Anyways more is merrier…

Q: hexadecimal integer (concatenation of characters ( lengths of following texts of positions of it ) of concatenation of (concatenation of characters ( lengths of following texts of positions of it ) of it ) of (substrings (integers in (0, length of it, 2), 2) of (value “ComputerId” of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions” of registry as string)))