المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : getting nested groups from AD with win32 API



C++ Programming
04-03-2009, 11:30 PM
I have been searching the internet for days trying to figure this out and the only thing I can find is other people with this problem and no resolution.

I am writing a C++ application that does not require .NET of any kind.

I can get the currently logged in users information using the NetWkstaUserGetInfo() API call. I then pass the username and domain to the NetUserGetGroups() function and can get back the groups that the user is a member of, but it doesn't show nested groups.

Example:

Group 1
|____Group A
|____*User1*
Group 2
|____Group B
|____*User1*

If a user, *User1*, is a member of "Group A" and a member of "Group 2" I would like for the function to return:
Group A (explicit membership)
Group 1 (implicit membership thru Group A)
Group 2 (explicit membership)

Right now it is only showing:
Group A (explicit membership)
Group 2 (explicit membership)


Please tell me someone has done this before without .NET!http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif