Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add user (NT 40)

Posted on 1998-07-16
1
Medium Priority
?
560 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

730 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