In Active Directory, I see that objectGUID are octet string binary 16 bytes fields. How is this conversion happening?
Is the binary converted to octetstring by splitting the fields in chunks? Like a Uint8Array?
How does it eventually become something like:
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
I just had to do this myself and found a PowerShell snippet that I had from over a decade ago, I tested it today and it still works.
The first line of code removes the backlash character in case your octet string is in the following format: '\bb\85\43\3e\43\7c\eb\4f\8e\a2\97\c6\5c\c0\6a\bf'
Input: $OctetString = '\bb\85\43\3e\43\7c\eb\4f\8e\a2\97\c6\5c\c0\6a\bf'
Output: '3e4385bb-7c43-4feb-8ea2-97c65cc06abf'
In case you want to convert the other direction:
Input: $guid= '3e4385bb-7c43-4feb-8ea2-97c65cc06abf'
Output: '\bb\85\43\3e\43\7c\eb\4f\8e\a2\97\c6\5c\c0\6a\bf'