Creating/Managing User Accounts Programmatically

Last reviewed: January 5, 1995
Article ID: Q119671
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) for Windows NT, versions 3.1 and 3.5

SUMMARY

Windows NT and the Windows NT Advanced Server use the same APIs that Microsoft LAN Manager uses to create and maintain user- and group-account information. For example, to create a new global group, use NetGroupAdd(). To create a new user, use NetUserAdd(). To add the user to the global group, use NetGroupAddUser(). Local groups are created by using NetLocalGroupAdd() and members are added to local groups by using NetLocalGroupAddMember().

MORE INFORMATION

The APIs NetGroupAdd(), NetUserAdd(), NetGroupAddUser(), NetLocalGroupAdd(), and NetLocalGroupAddMember() require access at the administrator or accounts-operator level to run successfully. Windows NT includes the following built-in groups:

  • Administrators
  • Power Users
  • Users
  • Guests

Members of the Administrators group can fully administer user accounts; only Administrators can assign user rights and access privileges for resources. Members of the Power Users group can create accounts only in the Power Users, Users, and Guests groups; they can also maintain and delete the accounts they create. However, a Power User can neither change nor delete an account in these groups if the account was created by someone else. A member of the Users group can create, maintain, and delete accounts in local groups that he or she has created. Guests can neither create nor delete accounts.

REFERENCES

In the Win32 SDK, version 3.1, the documentation for the ported LAN Manager APIs is available in the file LMAPI.HLP on the SDK CD. In the installed Win32 SDK, version 3.5, the ported LAN Manager APIs are documented in the Help file "Win32 API Reference".


Additional reference words: 3.10 3.50
KBCategory: kbprg
KBSubcategory: NtwkLmapi


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 5, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.