Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to find domain in S-1-5-21domain-513

I need to find out by any API this domain value of a certain DOMAIN. and then use ConvertStringSidToSid() to get the SID of the Domain user.

C++
if(CheckTokenMembership(hImpToken, DomainUserGroup, &bIsMember))
{
    ConvertStringSidToSid("S-1-5-21domain-513",DomainUserGroup);
}


Use this link:-http://support.microsoft.com/kb/243330[^]
Posted
Updated 9-Feb-15 2:55am
v3
Comments
Mike Nordell 12-Feb-15 20:54pm    
From my understanding of that documentation, especially since the domain part is in italics, wouldn't "domain" in your literal example refer to a domain named "domain"?

That is, if you want to check if a user belongs to the domain FOO, you'd use the string "S-1-5-21FOO-23".

Hope it at least gets you closer to a solution.

++luck;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900