Solved

Add user (NT 40)

Posted on 1998-07-16
1
542 Views
Last Modified: 2013-12-03

I'm trying to add new users on NT 40 with a Win32 program which is executed by the  administrator. Using NetUserAdd I get a new user which belongs to no group. After that I can't add a group to this new user. Either NetGroupAddUser or NetUserSetGroups return NERR_GroupNotFound. Calls to NetQueryDisplayInformation or NetGroupEnum return only one group with the name = "Kein" (this is "No") and comment = "Gewöhnlicher Benutzer" (this is "Common User") (it is a german system). Wher are my groups and how can I add one to my new user?

Thanks, Lutz Wiggershaus
0
Comment
Question by:wiggershaus
1 Comment
 
LVL 7

Accepted Solution

by:
BlackMan earned 200 total points
ID: 1410351
Are you running in a domain or on a local server?
NetGroupAddUser is for domains, NetLocalGroupAddMembers is local accounts.
If you are running in a domain, note that you must specify the PDC name as the servername.

NetLocalGroupAddMembers has the following declaration:

NET_API_STATUS NetLocalGroupAddMembers(
  LPWSTR servername,      
  LPWSTR LocalGroupName,  
  DWORD level,            
  LPBYTE buf,            
  DWORD membercount      
);
 
Parameters:
servername
Pointer to a null-terminated Unicode string containing the name of the remote server on which the function is to execute. A NULL pointer or string specifies the local computer.

LocalGroupName
Pointer to a null-terminated Unicode string containing the name of the local group to which the specified users or global groups will be added.

level
Specifies one of the following values to set the level of information provided. Value Meaning
0 The buf parameter points to an array of LOCALGROUP_MEMBERS_INFO_0 structures.
3 The buf parameter points to an array of LOCALGROUP_MEMBERS_INFO_3 structures.

buf
Pointer to a buffer containing the data for the new members.

membercount
Specifies the number of entries in the buffer pointed to by the buf parameter.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now