No navigation frame on the left?  Click here.

NetUserEnum

This sample demonstrates NetUserEnum() and NetQueryDisplayInformation(). Both are able to list users; the latter function also lists groups and machines, and you can set a specific starting point with NetGetDisplayInformationIndex() (not demonstrated).

Note that up to and including NT 4.0 SP2, NetQueryDisplayInformation() had a severe memory leak.

nue_nqdi.cpp, 4 KB