开发者

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?


You just can use SecurityIdentifier class.


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());
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜