GUID and SID converter
Paste an objectGUID or an objectSid in any form it turns up in: the GUID itself, the base64 of an LDIF export or an immutableId, the bytes that LDP or ADSI Edit shows, the escaped bytes of an LDAP filter, or a SID such as S-1-5-32-544.
How a GUID is stored
The text form of a GUID writes its first three fields as numbers. Stored, as objectGUID is, those three fields keep their bytes in little-endian order and the last eight bytes stay as written: 9e5bab01-07dc-4ba1-a88f-93342f4b0927 is kept as 01 ab 5b 9e dc 07 a1 4b a8 8f 93 34 2f 4b 09 27. Base64 of those 16 bytes is what an LDIF export shows.
Microsoft Entra Connect calls its source anchor the immutableId. It is objectGUID in a single forest with express settings, and it encodes a source anchor that is not text, such as a GUID, in base64: so the immutableId of such an account is the base64 of its objectGUID bytes. Newer versions use ms-DS-ConsistencyGuid, which they fill from objectGUID.
How a SID is stored
A stored SID, as objectSid is, is one byte for the revision (always 1), one byte for the number of sub-authorities (at most 15), six bytes for the identifier authority (5 for the NT authority), then each sub-authority as four bytes in little-endian order. The last sub-authority of an account's SID is its relative identifier, the RID; the SID before it is the domain's.
Bytes in an LDAP filter
A binary value goes into an LDAP filter as a backslash and two hexadecimal digits per byte, so (objectGUID=\01\ab\5b...) finds an object by its GUID. The LDAP filter page reads such filters.
Sources
- Byte layouts: Microsoft's open specification [MS-DTYP], sections 2.3.4.2 (GUID) and 2.4.2.2 (SID); the RID: [MS-MWBE] section 2.2.3.2.2.
- Bytes in a filter: Microsoft's page Search Filter Syntax.
- immutableId: Microsoft's page Microsoft Entra Connect: Design concepts, from entra-docs at commit 3413d15.
More Active Directory tools
-
Logon failure decoder
Read failed logon events 4625, 4771 and 4776: Status and Sub Status, Kerberos failure codes and logon types.
-
LDAP error decoder
Read an LDAP error from Active Directory: result code 49 and data 52e, 775, 773 or 532.
-
userAccountControl decoder
Read 512, 514, 66048 or any other userAccountControl value flag by flag, or tick flags to build one.
-
AD rights GUID lookup
Name the GUIDs in an ACL or event 4662: extended rights, property sets, classes and attributes.
-
groupType and sAMAccountType decoder
Turn -2147483646 or 805306368 into a group scope, a group type or an account type.
-
Kerberos encryption types decoder
Decode msDS-SupportedEncryptionTypes and ticket encryption types, and see where RC4 is still allowed.
-
Active Directory timestamp converter
Convert lastLogonTimestamp, pwdLastSet and other 18-digit values to dates and back.
-
SDDL and SID decoder
Read a security descriptor string in plain words and look up well-known SIDs.
-
LDAP filter builder and explainer
Read an LDAP filter in plain words, with the bitwise and nested-group rules, or build one for common searches.