Solved

Add user (NT 40)

Posted on 1998-07-16
1
553 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

685 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