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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's the secret to make the NetUserGetGroups API call work?

Status
Not open for further replies.

Calen

Programmer
Sep 19, 2002
26
0
0
US
Hi,

I'm trying to use the NetUserGetGroups API call, but it isn't returning all of the Groups that I am a member of.

I'm using the code from the Forum FAQ (which is the same as what MSDN has), and the EntriesRead = 8, while the TotalEntries = 16. But, I'm a member of 19 NT Groups.

What do I need to tweak to get a complete list of Groups?


Thanks a million in advance,

Calen
 
To answer my own question:

Make the buffer large enough. In the code example in the FAQ, the Buffer Length (BufLen) was set to 255. When I tried setting it to 511, I got the complete list of Groups I'm a member of.

Thanks to strongm for the tip (in a previous thread) that (eventually) led me to the answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top