cagatay
cagatay

Reputation: 477

Converting SID in HES to SDDL format

I am doing an LDAP query to get the distinguished name of a User. The DN section contains the Guid and SID but the SID section is HEX.

How can I convert this SID in HES format to SDDL format?

Upvotes: 1

Views: 2243

Answers (2)

AeroX
AeroX

Reputation: 3443

To expand on JPBlanc's Answer...

You can create a small helper function for this, like so:

private static String ResolveSID(Byte[] sidBytes)
{
    return (new System.Security.Principal.SecurityIdentifier(sidBytes, 0).ToString());
}

Upvotes: 0

JPBlanc
JPBlanc

Reputation: 72660

You just can use SecurityIdentifier class.

Upvotes: 1

Related Questions