Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Add user (NT 40)

Posted on 1998-07-16
1
Medium Priority
?
561 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 800 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

926 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