please dont rip this site Prev Next

NetUserSetInfo info  Overview  Group

The NetUserSetInfo function sets the parameters of a user account.

Security Requirements

Only members of the Administrators or Account Operators local group can successfully execute NetUserSetInfo on a remote server or on a computer that has local security enabled. A user may call NetUserSetInfo to set certain information on his or her own account.

NET_API_STATUS NetUserSetInfo(

    LPWSTR servername,

    LPWSTR username,

    DWORD level,

    LPBYTE buf,

    LPDWORD parm_err 

   );

Parameters

servername
Pointer to a 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.
username
Pointer to a Unicode string containing the name of the user account to set information.
level
Specifies one of the following values to set the level of information provided.

Value

Meaning

0

The buf parameter points to a USER_INFO_0 structure.

1

The buf parameter points to a USER_INFO_1 structure.

2

The buf parameter points to a USER_INFO_2 structure.

3

The buf parameter points to a USER_INFO_3 structure.

21

The buf parameter points to a USER_INFO_21 structure.

22

The buf parameter points to a USER_INFO_22 structure.

1003

The buf parameter points to a USER_INFO_1003 structure.

1005

The buf parameter points to a USER_INFO_1005 structure.

1006

The buf parameter points to a USER_INFO_1006 structure.

1007

The buf parameter points to a USER_INFO_1007 structure.

1008

The buf parameter points to a USER_INFO_1008 structure.

1009

The buf parameter points to a USER_INFO_1009 structure.

1010

The buf parameter points to a USER_INFO_1010 structure.

1011

The buf parameter points to a USER_INFO_1011 structure.

1012

The buf parameter points to a USER_INFO_1012 structure.

1013

The buf parameter points to a USER_INFO_1013 structure.

1014

The buf parameter points to a USER_INFO_1014 structure.

1017

The buf parameter points to a USER_INFO_1017 structure.

1020

The buf parameter points to a USER_INFO_1020 structure.

1024

The buf parameter points to a USER_INFO_1024 structure.

1051

The buf parameter points to a USER_INFO_1051 structure.

1053

The buf parameter points to a USER_INFO_1053 structure.

buf
Pointer to the buffer in which the data set with the level parameter is stored. The returned buffer should be deallocated using the NetApiBufferFree function. 
parm_err
Optional pointer to a DWORD that contains the index of the first parameter that causes ERROR_INVALID_PARAMETER. If NULL the parameter is not returned on error.

Remarks

The NetUserSetInfo function can be called to change a user's password only by users or applications having administrative privileges. However, the password can be changed by users or applications knowing the current password and calling NetUserChangePassword. When an administrator calls NetUserSetInfo, the only restriction applied is that the new password length must be consistent with system modals.

Members of the Administrators local group can set any modifiable element. All users can set the usri2_usr_comment, usri2_parms, and usri2_country_code, elements of the user_info_2 data structure for their own accounts. To do this, the user must use the ParmNum parameter and cannot pass the whole structure.

A member of the Account Operator's local group cannot set details for an Administrators class account, give an existing account Administrator privilege, or change the operator privilege of any account. If attempting to change the privilege level or disable the last account with Administrator privilege in the database, NetUserSetInfo fails and returns NERR_LastAdmin.

You can call NetUserSetInfo with USER_INFO_1 and specify a value using the usri1_name member. However, that value will be ignored. The correct way to specify the new name of the group is to call NetUserSetInfo with USER_INFO_0 and specify a value using the usri0_name member.

The NetUserSetInfo function cannot be used to change the home directory for user accounts that were not created by the Net server.

Return Values

If the function is successful, it returns NERR_SUCCESS.

If the function fails, the return value is one of the following error codes.

Value

Meaning

ERROR_ACCESS_DENIED

The user does not have access to the requested information.

NERR_InvalidComputer

The computer name is invalid.

NERR_NotPrimary

The operation is allowed only on the primary domain controller of the domain.

NERR_SpeGroupOp

The operation is not allowed on specified special groups, which are user groups, admin groups, local groups, or guest groups.

NERR_LastAdmin

The operation is not allowed on the last administrative account.

NERR_BadPassword

The share name or password is invalid.

NERR_PasswordTooShort

The password is shorter than required.

NERR_UserNotFound

The user name could not be found.

See Also

NetUserGetInfo


file: /Techref/os/win/api/win32/func/src/f64_7.htm, 13KB, , updated: 2000/4/7 11:19, local time: 2024/11/28 12:23,
TOP NEW HELP FIND: 
18.225.72.161:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/techref/os/win/api/win32/func/src/f64_7.htm"> NetUserSetInfo</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .