Need API to access the user group to which a currently logged in user belongs
-
Hi, I am looking for an API that will return the 'group' to which the currently logged in user belongs. Or is it a way to know if the currently logged in user belongs to a paricular user group?
Hi there, Do you mean you want to list the groups of the user running your program? I think the process is (sorry I don't have any example code): ImpersonateSelf() - to generate an access token for the current process OpenThreadToken() - to open the access token GetTokenInformation() specifying TokenPrimaryGroup or TokenGroup as one of the parameters - to get a data structure with group information Then walk the structure from this last function, looking for the group SID or SIDs. Finally, to convert a SID to an actual text group name, use: LookupAccountSid() Hope this is a pointer in the right direction ! Thanks, Neil Humphreys.
-
Hi, I am looking for an API that will return the 'group' to which the currently logged in user belongs. Or is it a way to know if the currently logged in user belongs to a paricular user group?
look at
NetUserGetLocalGroups
defined inLM.h
underPSDK
"I Think this Will Help" [Vote One Here,.....]
visit me at http://www.thisisalok.tk
-
look at
NetUserGetLocalGroups
defined inLM.h
underPSDK
"I Think this Will Help" [Vote One Here,.....]
visit me at http://www.thisisalok.tk