How to programmatically figure out if a user account is a member of a particular group in Windows?

后端 未结 3 1466
夕颜
夕颜 2020-12-17 05:39

Given a group name and a user account, I would like to know if the supplied user belongs to a particular group. The user can be a local user or a domain user and the group c

3条回答
  •  囚心锁ツ
    2020-12-17 06:09

    You need to read up on GetTokenInformation (TOKEN_USER), AllocateAndInitializeSid and CheckTokenMemberShip.

提交回复
热议问题