Solved

_USER_INFO_2

Posted on 1997-08-04
5
242 Views
Last Modified: 2008-03-06
I need some detailed information for the following _user_info_2 structure parameters:

usri2_priv, usri2_flags, usri2_auth_flags, usri2_parms,
_workstations,_max_storage,_logon_server

Thanks
0
Comment
Question by:vangelis063097
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
md041797 earned 30 total points
ID: 1166682
typedef struct _USER_INFO_2 {    LPWSTR    usri2_name;    LPWSTR    usri2_password;    DWORD     usri2_password_age;    DWORD     usri2_priv;    LPWSTR    usri2_home_dir;    LPWSTR    usri2_comment;    DWORD     usri2_flags;    LPWSTR    usri2_script_path;    DWORD     usri2_auth_flags;    LPWSTR    usri2_full_name;    LPWSTR    usri2_usr_comment;    LPWSTR    usri2_parms;    LPWSTR    usri2_workstations;    DWORD     usri2_last_logon;    DWORD     usri2_last_logoff;    DWORD     usri2_acct_expires;    DWORD     usri2_max_storage;    DWORD     usri2_units_per_week;    PBYTE     usri2_logon_hours;    DWORD     usri2_bad_pw_count;    DWORD     usri2_num_logons;    LPWSTR    usri2_logon_server;    DWORD     usri2_country_code;    DWORD     usri2_code_page;}USER_INFO_2, *PUSER_INFO_2, *LPUSER_INFO_2; 

Members

usri2_name

Specifies the name of the user account. For NetUserSetInfo, this member is ignored. The number of characters in the name cannot exceed the value of UNLEN.

usri2_password

The password for the user specified in the usri2_name member. The length cannot exceed PWLEN bytes. The NetUserEnum and NetUserGetInfo functions return a NULL pointer to maintain password security. By convention, Windows NT limits the length of passwords to LM20_PWLEN characters. This convention allows LAN Manager, Windows 3.x, Windows for Workgroups 3.x, and Windows 95 clients to access a Windows NT server using the account.

usri2_password_age

Specifies the number of seconds elapsed since the usri2_password member was last changed. The NetUserAdd and NetUserSetInfo functions ignore this member.

usri2_priv

One of three values specifying the level of privilege assigned the usri2_name member. For NetUserAdd, this member must be USER_PRIV_USER. For NetUserSetInfo, this member must be the value returned from NetUserGetInfo or NetUserEnum. This member can be one of the following values:

Value      Meaning
USER_PRIV_GUEST      Guest
USER_PRIV_USER      User
USER_PRIV_ADMIN      Administrator
 

usri2_home_dir

Points to a Unicode string containing the path of the home directory for the user specified in the user_name member. The string can be null.

usri2_comment

Points to a Unicode string that contains a comment. The string can be a null string, or it can have any number of characters before the terminating null character.

usri2_flags

Contains values that determine several features. This member can be any of the following values:

Value      Meaning
UF_SCRIPT      The logon script executed. This value must be set for LAN Manager 2.0 or Windows NT.
UF_ACCOUNTDISABLE      The user's account is disabled.
UF_HOMEDIR_REQUIRED      The home directory is required. This value is ignored in Windows NT.
UF_PASSWRD_NOTREQD      No password is required.
UF_PASSWRD_CANT_CHANGE       The user cannot change the password.
UF_LOCKOUT      The account is currently locked out. For NetUserSetInfo, this value can be cleared to unlock a previously locked account. This value cannot be used to lock a previously unlocked account.
UF_DONT_EXPIRE_PASSWORD      Represents the password, which should never expire on the account. This value is valid only for Windows NT.
 

The following values describe the account type. Only one value can be set. You cannot change the account type using the NetUserSetInfo function.

Value      Meaning
UF_NORMAL_ACCOUNT      This is a default account type that represents a typical user.
UF_TEMP_DUPLICATE_ACCOUNT      This is an account for users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. The User Manager refers to this account type as a local user account.
UF_WORKSTATION_TRUST_ACCOUNT      This is a computer account for a Windows NT Workstation or Windows NT Server that is a member of this domain.
UF_SERVER_TRUST_ACCOUNT      This is a computer account for a Windows NT Backup Domain Controller that is a member of this domain.
UF_INTERDOMAIN_TRUST_ACCOUNT      This is a permit to trust account for a Windows NT domain that trusts other domains.
 

usri2_script_path

Points to a Unicode string specifying the path of the user's logon script, .CMD, .EXE, or .BAT file. The string can be null.

usri2_auth_flags

Specifies an unsigned long integer that contains values that specify the user's operator privileges.

Windows NT: For Windows NT servers, the following restrictions apply:

7      For NetUserAdd, this member must be zero.
7      For NetUserSetInfo, this member must be the value returned from NetUserGetInfo or NetUserEnum.
 

For NetUserGetInfo or NetUserEnum, the appropriate value is returned based on the local group membership. If the user is a member of Print Operations, AF_OP_PRINT is set. If the user is a member of Server Operations, AF_OP_SERVER is set. If the user is a member of the Account Operations, AF_OP_ACCOUNTS is set. AF_OP_COMM is never set.
This member can be one of the following values:

Value      Meaning
AF_OP_PRINT      The print operator privilege is enabled.
AF_OP_COMM      The communications operator privilege is enabled.
AF_OP_SERVER      The server operator privilege is enabled.
AF_OP_ACCOUNTS      The accounts operator privilege is enabled.
 

usri2_full_name

Points to a Unicode string that contains the full name of the user. This string can be a null string, or it can have any number of characters before the terminating null character.

usri2_usr_comment

Points to a Unicode string that contains a user comment. This string can be a null string, or it can have any number of characters before the terminating null character.

usri2_parms

Points to a Unicode string that is set aside for use by applications. This string can be a null string, or it can have any number of characters before the terminating null character. Microsoft products use this member to store user configuration information. Do not modify this information.

usri2_workstations

Points to a Unicode string that contains the names of workstations from which the user can log on. As many as eight workstations can be specified; the names must be separated by commas (,). A null string indicates that there is no restriction. To disable logons from all workstations to this account, set the UF_ACCOUNTDISABLE value in the usri*_flags member.

usri2_last_logon

Specifies when the last logon occurred. This value is stored as the number of seconds elapsed since 00:00:00, January 1, 1970. This member is ignored in NetUserAdd and NetUserSetInfo calls. This member is maintained separately on each Backup Domain Controller (BDC) in the domain. To get an accurate value, each BDC in the domain must be queried, and the largest value is used.

usri2_last_logoff

Specifies when the last logoff occurred. This value is stored as the number of seconds elapsed since 00:00:00, January 1, 1970. A value of zero means that the last logoff time is unknown. This member is maintained separately on each Backup Domain Controller (BDC) in the domain. To get an accurate value, each BDC in the domain must be queried, and the largest value is used.

usri2_acct_expires

Specifies when the account will expire. This value is stored as the number of seconds elapsed since 00:00:00, January 1, 1970. A value of TIMEQ_FOREVER indicates that the account never expires.

usri2_max_storage

Specifies the maximum amount of disk space the user can use. Use the value specified in USER_MAXSTORAGE_UNLIMITED to use all available disk space.

usri2_units_per_week

Specifies the number of equal-length time units into which the week is divided in order to compute the length of the bit string in the usri2_logon_hours member. This value must be UNITS_PER_WEEK for LAN Manager 2.0. This element is ignored in NetUserAdd and NetUserSetInfo functions. For Windows NT services, the units must be one of the following: SAM_DAYS_PER_WEEK, SAM_HOURS_PER_WEEK, or SAM_MINUTES_PER_WEEK.

usri2_logon_hours

Points to a 21-byte (168 bits) bit string that specifies the times during which the user can log on. Each bit represents a unique hour in the week. The first bit (bit 0, word 0) is Sunday, 0:00 to 0:59; the second bit (bit 1, word 0) is Sunday, 1:00 to 1:59; and so on. A null pointer in this element for NetUserAdd calls means that there is no time restriction. A null pointer in this element for NetUserSetInfo calls means that no change is to be made.

usri2_bad_pw_count

Specifies the number of times the user tried to log on to the account using an incorrect password. A value of 0xFFFFFFFF indicates that the value is unknown. This member is ignored in NetUserAdd and NetUserSetInfo calls. This member is maintained separately on each Backup Domain Controller (BDC) in the domain. To get an accurate value, each BDC in the domain must be queried, and the largest value is used.

usri2_num_logons

Counts the number of successful times the user tried to log on to this account. A value of 0xFFFFFFFF indicates that the value is unknown. This member is ignored in NetUserAdd and NetUserSetInfo calls. This member is maintained separately on each Backup Domain Controller (BDC) in the domain. To get an accurate value, each BDC in the domain must be queried, and the largest value is used.

usri2_logon_server

Points to a Unicode string that contains the name of the server to which logon requests are sent. Servernames should be preceded by two backslashes (\\). When the servername is indicated by an asterisk (\\*), the logon request can be handled by any logon server. A null string indicates that requests are sent to the domain controller.

Windows NT: For Windows NT Servers, NetUserGetInfo and NetUserEnum return \\*. The NetUserAdd and NetUserSetInfo functions ignore this member.

usri2_country_code

Specifies the country code for the user's language of choice.

usri2_code_page

Specifies the code page for the user's language of choice.

 
0
 

Author Comment

by:vangelis063097
ID: 1166683
Thanks,

Can you be more specific about the  USR2_MAX_STORAGE ?

What values does it take?

0
 
LVL 4

Expert Comment

by:md041797
ID: 1166684
The max bytes of user storage space allowed for this user.
0
 

Author Comment

by:vangelis063097
ID: 1166685
How can you set this property numerically, that is how
can you assign a numerical value to it? I can set all the
other parameters of the structure but this one returns, which returns to the default value.
0
 
LVL 4

Expert Comment

by:md041797
ID: 1166686
I'm don't have a clue.  Perhaps you should post this one question under windows/programming.  It's more likely you will get an answer there.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

706 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