网站首页  词典首页

请输入您要查询的函数:

 

术语 netlocalgroupsetmembers
释义 NetLocalGroupSetMembers
语法:
C++
NET_API_STATUS NetLocalGroupSetMembers(
__in LPCWSTR servername,
__in LPCWSTR groupname,
__in DWORD level,
__in LPBYTE buf,
__in DWORD totalentries
);
NetLocalGroupSetMembers功能
该NetLocalGroupSetMembers函数设置指定的本地组成员。每个用户或全局组指定了一个本地组的成员。用户或没有指定,但目前谁是本地组的成员将取消其会员资格的全局组。
参数
服务器名 [in]
指针常量字符串指定的DNS或NetBIOS的远程服务器上的功能是执行的名称。如果该参数为NULL,则使用本地计算机。
群组名称 [in]
指针常量字符串指定本地组中指定的用户或全局组的成员应给予的名称。有关详细信息,请参阅下面的备注部分。
Level [in]
指定的数据信息的Level。此参数可以是下列值之一。
ValueMeaning
0Specifies的安全标识符(SID)与本地组的成员联系。在buf参数指向一个LOCALGROUP_MEMBERS_INFO_0结构的数组。
3Specifies帐户和本地组的成员域名。在buf参数指向一个LOCALGROUP_MEMBERS_INFO_3结构的数组。
缓冲带 [in]
缓冲区指针包含成员的信息。这一数据格式取决于Level的参数值。有关更多信息,请参阅网络管理功能的缓冲器。
totalentries [in]
指定一个值,它包含的条目在缓冲区总数指向的buf参数。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值可以是下面的错误代码之一。
返回codeDescription
NERR_GroupNotFoundThe小组参数指定的群组名称不存在。
ERROR_ACCESS_DENIEDThe用户没有获得所需的信息。
ERROR_NO_SUCH_MEMBEROne或多个成员不存在。本地组的成员没有改变。
ERROR_INVALID_MEMBEROne或多个成员不能被添加,因为它有一个无效的帐户类型。本地组的成员没有改变。
备注
如果您调用域控制器上运行Active Directory的这一功能,允许访问或拒绝的访问控制列表的安全对象(ACL)的基础。默认的ACL只允许域管理员和Account Operators调用此函数。在成员服务器或工作站,只有Administrators和Power Users可以调用这个函数。有关更多信息,请参阅的网络管理功能的安全要求。欲了解更多有关的ACL,ACE的,和访问令牌信息,请访问控制模型。
该LocalGroup对象的安全描述符用于执行此函数访问检查。
您可以用一种完全新的成员名单通过调用函数的局部NetLocalGroupSetMembers组成员。典型的步骤顺序执行此如下。
以取代本地组成员
调用NetLocalGroupGetMembers函数来检索成员名单。
修改返回的成员名单,以反映新的成员。
调用NetLocalGroupSetMembers函数替换为新老成员名单成员名单。
要添加一个或多个现有的用户帐户或组帐户全球现有的本地组,您可以调用NetLocalGroupAddMembers功能。若要从现有的本地组的一个或多个成员,调用NetLocalGroupDelMembers功能。
用户帐户名称被限制为20个字符和组名称被限制为256个字符。此外,帐户名称不能终止的期间,他们不能包含逗号或以下打印字符:“,/,\\,[,]:,|,”,“+,=,,,?, *.名称也不能包括在1-31范围内,这些非打印字符。
如果您是Active Directory的程序,您可以调用某些Active Directory服务接口(ADSI)的方法来达到同样的功能,您可以通过调用实现网络管理本地组的职能。有关更多信息,请参阅IADsGroup。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmaccess.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
本地组功能
LOCALGROUP_MEMBERS_INFO_0
LOCALGROUP_MEMBERS_INFO_3
NetLocalGroupGetMembers
NetLocalGroupAddMembers
NetLocalGroupDelMembers
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetLocalGroupSetMembers Function
The NetLocalGroupSetMembers function sets the membership for the specified local group. Each user or global group specified is made a member of the local group. Users or global groups that are not specified but who are currently members of the local group will have their membership revoked.
Syntax
C++
NET_API_STATUS NetLocalGroupSetMembers(
__in LPCWSTR servername,
__in LPCWSTR groupname,
__in DWORD level,
__in LPBYTE buf,
__in DWORD totalentries
);
Parameters
servername [in]
Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.
groupname [in]
Pointer to a constant string that specifies the name of the local group in which the specified users or global groups should be granted membership. For more information, see the following Remarks section.
level [in]
Specifies the information level of the data. This parameter can be one of the following values.
ValueMeaning
0Specifies the security identifier (SID) associated with a local group member. The buf parameter points to an array of LOCALGROUP_MEMBERS_INFO_0 structures.
3Specifies the account and domain names of the local group member. The buf parameter points to an array of LOCALGROUP_MEMBERS_INFO_3 structures.

buf [in]
Pointer to the buffer that contains the member information. The format of this data depends on the value of the level parameter. For more information, see Network Management Function Buffers .
totalentries [in]
Specifies a value that contains the total number of entries in the buffer pointed to by the buf parameter.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value can be one of the following error codes.
Return codeDescription
NERR_GroupNotFoundThe group specified by the groupname parameter does not exist.
ERROR_ACCESS_DENIEDThe user does not have access to the requested information.
ERROR_NO_SUCH_MEMBEROne or more of the members doesn't exist. The local group membership was not changed.
ERROR_INVALID_MEMBEROne or more of the members cannot be added because it has an invalid account type. The local group membership was not changed.

Remarks
If you call this function on a domain controller that is running Active Directory, access is allowed or denied based on the access control list (ACL) for the securable object . The default ACL permits only Domain Admins and Account Operators to call this function. On a member server or workstation, only Administrators and Power Users can call this function. For more information, see Security Requirements for the Network Management Functions . For more information on ACLs, ACEs, and access tokens, see Access Control Model .
The security descriptor of the LocalGroup object is used to perform the access check for this function.
You can replace the local group membership with an entirely new list of members by calling the NetLocalGroupSetMembers function. The typical sequence of steps to perform this follows.
To replace the local group membership
Call the NetLocalGroupGetMembers function to retrieve the current membership list.
Modify the returned membership list to reflect the new membership.
Call the NetLocalGroupSetMembers function to replace the old membership list with the new membership list.
To add one or more existing user accounts or global group accounts to an existing local group, you can call the NetLocalGroupAddMembers function. To remove one or more members from an existing local group, call the NetLocalGroupDelMembers function.
User account names are limited to 20 characters and group names are limited to 256 characters. In addition, account names cannot be terminated by a period and they cannot include commas or any of the following printable characters: ", /, \\, [, ], :, |, <, >, +, =, ;, ?, *. Names also cannot include characters in the range 1-31, which are nonprintable.
If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling the network management local group functions. For more information, see IADsGroup .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmaccess.h (include Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
Network Management Overview
Network Management Functions
Local Group Functions
LOCALGROUP_MEMBERS_INFO_0
LOCALGROUP_MEMBERS_INFO_3
NetLocalGroupGetMembers
NetLocalGroupAddMembers
NetLocalGroupDelMembers
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370604(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:32:18