Solved

Add user (NT 40)

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

20 Experts available now in Live!

Get 1:1 Help Now