Home   Index   About
Ultimate Pack


Custom Search
User Functions

The user functions control a user's account in the security database. The user functions are:

NetUserAdd
NetUserChangePassword
NetUserDel
NetUserEnum
NetUserGetGroups
NetUserGetInfo
NetUserGetLocalGroups
NetUserSetGroups
NetUserSetInfo

Each user or application that accesses resources must have an account in the security database. The Windows NT server directory services use this user account to verify that the user or application has permission to use a resource. When a user or an application requests access to a resource, the security system checks for an appropriate user account or group account to permit the access.

The NetUserEnum can be used to list all user accounts in a domain. An application can verify the groups to which a user belongs by calling NetUserGetGroups, which returns a list of global group names. The NetUserGetLocalGroups function does the same for local groups. When a user account is no longer needed, use NetUserDel to delete the account from the server. Once the account is removed, the user can no longer access the server, except by using the guest account. Because the user's password is confidential, it is not returned by NetUserEnum or NetUserGetInfo. The password is initially assigned when NetUserAdd is called. NetUserChangePassword function changes a user's password for a specified network server or domain. The NetUserSetInfo function sets the password and other elements of a user account.

User account information is available at seven levels:

USER_INFO_0
USER_INFO_1
USER_INFO_2

USER_INFO_3

USER_INFO_10

USER_INFO_11

USER_INFO_20

The following information levels are valid only for NetUserSetInfo:

USER_INFO_1003
USER_INFO_1005

USER_INFO_1006

USER_INFO_1007

USER_INFO_1008

USER_INFO_1009

USER_INFO_1010

USER_INFO_1011

USER_INFO_1012

USER_INFO_1013

USER_INFO_1014

USER_INFO_1017

USER_INFO_1018

USER_INFO_1020

USER_INFO_1023

USER_INFO_1024

USER_INFO_1025

USER_INFO_1051

USER_INFO_1052

USER_INFO_1053

For NetUserSetInfo, parmnum values refer to the members of the USER_INFO structure, as follows. These values are used when indicating an error in a specific parameter through parm_err.

parmnum value
Member of user_info structure
USER_NAME_PARMNUM
usri_name
USER_PASSWORD_PARMNUM
usri_password
USER_PASSWORD_AGE_PARMNUM
usri_password_age
USER_PRIV_PARMNUM
usri_priv
USER_HOME_DIR_PARMNUM
usri_home_dir
USER_COMMENT_PARMNUM
usri_comment
USER_FLAGS_PARMNUM
usri_flags
USER_SCRIPT_PATH_PARMNUM
usri_script_path
USER_AUTH_FLAGS_PARMNUM
usri_auth_flags
USER_FULL_NAME_PARMNUM
usri_full_name
USER_USR_COMMENT_PARMNUM
usri_usr_comment
USER_PARMS_PARMNUM
usri_parms
USER_WORKSTATIONS_PARMNUM
usri_workstations
USER_LAST_LOGON_PARMNUM
usri_last_logon
USER_LAST_LOGOFF_PARMNUM
usri_last_logoff
USER_ACCT_EXPIRES_PARMNUM
usri_acct_expires
USER_MAX_STORAGE_PARMNUM
usri_max_storage
USER_UNITS_PER_WEEK_PARMNUM
usri_units_per_week
USER_LOGON_HOURS_PARMNUM
usri_logon_hours
USER_PAD_PW_COUNT_PARMNUM
usri_bad_pw_count
USER_NUM_LOGONS_PARMNUM
usri_num_logons
USER_LOGON_SERVER_PARMNUM
usri_logon_server
USER_COUNTRY_CODE_PARMNUM
usri_country_code
USER_CODE_PAGE_PARMNUM
usri_code_page
USER_PRIMARY_GROUP_PARMNUM
usri_primary_group_id
USER_PROFILE
usri_profile
USER_HOME_DIR_DRIVE_PARMNUM
usri_home_dir_drive


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun