网站首页  词典首页

请输入您要查询的函数:

 

术语 netlocalgroupadd
释义 NetLocalGroupAdd
语法:
C++
NET_API_STATUS NetLocalGroupAdd(
__in LPCWSTR servername,
__in DWORD level,
__in LPBYTE buf,
__out LPDWORD parm_err
);
NetLocalGroupAdd功能
该NetLocalGroupAdd函数创建安全数据库中,这是安全帐户管理器(SAM)数据库或本地组,在域控制器的情况下,Active Directory中。
参数
服务器名 [in]
一个字符串,它指定的DNS或NetBIOS的远程服务器上的功能是执行名称的指针。如果该参数为NULL,则使用本地计算机。
Level [in]
数据的信息化Level。此参数可以是下列值之一。
ValueMeaning
答本地组的名称。在buf参数指向一个LOCALGROUP_INFO_0结构。
第1A本地组的名称和关联的评论与群体。在buf参数指向一个LOCALGROUP_INFO_1结构。
缓冲带 [in]
一个缓冲区,其中包含本地组信息结构的指针。这一数据格式取决于Level的参数值。有关更多信息,请参阅网络管理功能的缓冲器。
parm_err [out]
一个一个值,它接收的本地组信息结构的第一个成员的索引指针导致ERROR_INVALID_PARAMETER错误。如果该参数为NULL,则指数不返回的错误。有关详细信息,请参阅NetLocalGroupSetInfo主题备注部分。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值可以是下面的错误代码之一。
返回codeDescription
ERROR_ACCESS_DENIEDThe调用方没有适当的访问,以完成操作。
ERROR_ALIAS_EXISTSThe指定的本地组已存在。返回此错误,如果在结构组名成员指出的buf参数为的是在已经使用的别名。
ERROR_INVALID_LEVELALevel参数无效。
ERROR_INVALID_PARAMETERA参数不正确。此错误是返回的一个或结构的成员更尖锐的buf参数为无效。
NERR_GroupExistsThe组名称存在。 This error is returned if the group name member in the structure pointed to by the buf parameter is already in use as a group name.
NERR_InvalidComputerThe计算机名无效。
NERR_NotPrimaryThe操作只允许在该域的主域控制器。
NERR_UserExistsThe用户名存在。返回此错误,如果在结构组名成员指出的buf参数的是作为一个用户名已被使用。
备注
如果您调用域控制器上运行Active Directory的这一功能,允许访问或拒绝的访问控制列表的安全对象(ACL)的基础。默认的ACL只允许域管理员和Account Operators调用此函数。在成员服务器或工作站,只有Administrators和Power Users可以调用这个函数。有关更多信息,请参阅的网络管理功能的安全要求。欲了解更多有关的ACL,ACE的,和访问令牌信息,请访问控制模型。
用户的容器的安全描述符用于执行此函数访问检查。调用者必须能够创造出组类子对象。
用户帐户名称被限制为20个字符和组名称被限制为256个字符。此外,帐户名称不能终止的期间,他们不能包含逗号或以下打印字符:“,/,\\,[,]:,|,”,“+,=,,,?, *.名称也不能包括在1-31范围内,这些非打印字符。
如果NetLocalGroupAdd函数返回ERROR_INVALID_PARAMETER和一个NULL指针不通过parm_err参数对返回parm_err参数,显示本地组信息结构的第一个成员是无效的。本地组信息结构中指定格式的Level参数。阿本地组信息结构的指针传递buf参数。下表列出了可以返回的parm_err参数和相应的结构成员,在错误的价值观。
ValueMember
LOCALGROUP_NAME_PARMNUMIfLevel参数为0,该LOCALGROUP_INFO_0结构lgrpi0_name成员是无效的。
如果该参数为1级,该LOCALGROUP_INFO_1结构lgrpi1_name成员是无效的。
LOCALGROUP_COMMENT_PARMNUMIfLevel参数为1,该LOCALGROUP_INFO_1结构lgrpi1_comment成员是无效的。
要求时,域控制器和Active Directory,您可以调用某些Active Directory服务接口(ADSI)方法,以实现网络管理本地组功能相同的结果。有关更多信息,请参阅IADsGroup。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmaccess.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理功能,缓冲器
网络管理功能
网络管理概述
本地组功能
LOCALGROUP_INFO_0
LOCALGROUP_INFO_1
NetLocalGroupDel
NetLocalGroupSetInfo
NetLocalGroupAddMembers
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetLocalGroupAdd Function
The NetLocalGroupAdd function creates a local group in the security database, which is the security accounts manager (SAM) database or, in the case of domain controllers, the Active Directory.
Syntax
C++
NET_API_STATUS NetLocalGroupAdd(
__in LPCWSTR servername,
__in DWORD level,
__in LPBYTE buf,
__out LPDWORD parm_err
);
Parameters
servername [in]
A pointer to a 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.
level [in]
The information level of the data. This parameter can be one of the following values.
ValueMeaning
0A local group name. The buf parameter points to a LOCALGROUP_INFO_0 structure.
1A local group name and a comment to associate with the group. The buf parameter points to a LOCALGROUP_INFO_1 structure.

buf [in]
A pointer to a buffer that contains the local group information structure. The format of this data depends on the value of the level parameter. For more information, see Network Management Function Buffers .
parm_err [out]
A pointer to a value that receives the index of the first member of the local group information structure to cause the ERROR_INVALID_PARAMETER error. If this parameter is NULL, the index is not returned on error. For more information, see the Remarks section in the NetLocalGroupSetInfo topic.
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
ERROR_ACCESS_DENIEDThe caller does not have the appropriate access to complete the operation.
ERROR_ALIAS_EXISTSThe specified local group already exists. This error is returned if the group name member in the structure pointed to by the buf parameter is already in use as an alias.
ERROR_INVALID_LEVELA level parameter is invalid.
ERROR_INVALID_PARAMETERA parameter is incorrect. This error is returned if one or more of the members in the structure pointed to by the buf parameter is invalid.
NERR_GroupExistsThe group name exists. This error is returned if the group name member in the structure pointed to by the buf parameter is already in use as a group name.
NERR_InvalidComputerThe computer name is invalid.
NERR_NotPrimaryThe operation is allowed only on the primary domain controller of the domain.
NERR_UserExistsThe user name exists. This error is returned if the group name member in the structure pointed to by the buf parameter is already in use as a user name.

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 user container is used to perform the access check for this function. The caller must be able to create child objects of the group class.
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 the NetLocalGroupAdd function returns ERROR_INVALID_PARAMETER and a NULL pointer was not passed in parm_err parameter, on return the parm_err parameter indicates the first member of the local group information structure that is invalid. The format of the local group information structure is specified in the level parameter. A pointer to the local group information structure is passed in buf parameter. The following table lists the values that can be returned in the parm_err parameter and the corresponding structure member that is in error.
ValueMember
LOCALGROUP_NAME_PARMNUMIf the level parameter was 0, the lgrpi0_name member of the LOCALGROUP_INFO_0 structure was invalid.
If the level parameter was 1, the lgrpi1_name member of the LOCALGROUP_INFO_1 structure was invalid.
LOCALGROUP_COMMENT_PARMNUMIf the level parameter was 1, the lgrpi1_comment member of the LOCALGROUP_INFO_1 structure was invalid.

When making requests to a domain controller and Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same results as 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 Function Buffers
Network Management Functions
Network Management Overview
Local Group Functions
LOCALGROUP_INFO_0
LOCALGROUP_INFO_1
NetLocalGroupDel
NetLocalGroupSetInfo
NetLocalGroupAddMembers
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370434(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:24:23