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

NetUserGetLocalGroups / NetUserGetGroups

Status
Not open for further replies.

mattKnight

Programmer
May 10, 2002
6,239
GB
Hi all,

I have a routine that reads the local group memeberships for a NT/2000 user using NetUserGetLocalGroups API. I would like to extend the functionality to check domain groups.

However MSDN is fairly vague about NetUserGetGroups...

NET_API_STATUS NetUserGetGroups(
LPCWSTR servername,
LPCWSTR username,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries
);
Parameters
servername
[in] Pointer to a constant Unicode string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
username
... <snip>

My question uns about the value for server name:
should it be the Domain Controller (PDC), Local Machine or soemthing else. I assume the it should be PDC, but as I don't have access to a domain I can't test it!

The object is to allow the user's group memberships to access certain parts of the program.

As a side issue, my APIViewer doesn't show a value for constant MAX_PREFERRED_LENGTH, so I can't define it... Does any one know what it is?


Thanks all

Matt


 

For Max_Preferred_Length I believe it is 256. The easiest way to find out is use the advanced search feature of windows explorer and search for all files with your constant contained within. You are looking for a C/C++ header file that will have it declared.

There was a discussion about this in forum222 just a few weeks ago on the net API's. Search this site for you API and you may come up with the answer.

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top