Universally unique identifiers (UUIDs) are useful in various situations, especially in distributed computing, to identify information without central coordination. They have been standardized under RFC 4122, and can be accessed in Java using java.util.UUID.
Globally unique identifiers (GUIDs) are a subset of UUIDs. Microsoft uses them for identifying classes, interfaces, and other objects. In particular, I was interested in the objectGUID attribute for users in Active Directory, though the same technique should apply for all Microsoft GUIDs. Microsoft GUIDs are completely compatible with the UUID specification, with one exception: the binary encoding. In particular, RFC 4122 specifies that all segments must be encoded as big-endian, while Microsoft encodes the first 3 segments using the system’s native endianness (which for Windows is commonly little-endian).
If you’re getting access to the GUID as binary data (such as a byte array), you’ll need to do some processing before passing the data to the UUID class. Balazs Zagyvai‘s adsync4j project provides a useful example of this (see gist below). It also uses UnboundID LDAP SDK for Java, which I highly recommend if you’re accessing LDAP servers (including Active Directory) in Java.