Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking to see if user is in a specific group

Status
Not open for further replies.

Grasser

Programmer
Joined
Jul 15, 2002
Messages
2
Location
US
I am searching for a way to check if a user is a member of a specific group using Visual C++. Our application allows a user to belong to more than one group. I suspect that there is some sort of system call that either returns a list of groups that a user belongs to or else provides a boolean routine that checks if a user belongs
to a specific group. Either type would work. Thanks in advance.
 
Hi,

Before we can answer this we need to know what these groups are and how these groups are assigned to the user.

William
Software Engineer
ICQ No. 56047340
 
The groups that I am referring to are the Windows Access Control groups that are assigned using the Control Panel->Administrative Tools->Local Users and Groups->Groups dialog. I would like to create a set of groups that I can assign various users to. Then I would like to create some software that queries the operating system to determine what groups the person running the software belongs to. We expect to allow a user to belong to more than one of these newly defined groups.

I've seen some code samples that show how to check if the user is a member of the Administrators group but those examples do not seem to be extendable to any other groups.
 
Well in that case you need to use the NetUserGetGroups(...) function.

HTH
William
Software Engineer
ICQ No. 56047340
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top