网站首页  词典首页

请输入您要查询的函数:

 

术语 netrenamemachineindomain
释义 NetRenameMachineInDomain
语法:
C++
NET_API_STATUS NetRenameMachineInDomain(
__in LPCWSTR lpServer,
__in LPCWSTR lpNewMachineName,
__in LPCWSTR lpAccount,
__in LPCWSTR lpPassword,
__in DWORD fRenameOptions
);
NetRenameMachineInDomain功能
该NetRenameMachineInDomain功能变化在一个域中的计算机的名称。
参数
lpServer [in]
一个常量字符串,它指定的DNS或NetBIOS的计算机上调用函数名的指针。如果该参数为NULL,则使用本地计算机。
lpNewMachineName [in]
一个字符串常量,指定计算机的新名称的指针。如果指定的本地计算机名称改变。如果该参数为NULL,则函数假定您已经被称为SetComputerNameEx功能。
lpAccount [in]
一个字符串常量,指定的帐户时所使用的名称连接到域控制器的指针。如果该参数为NULL,则调用方的上下文被使用。
lpPassword [in]
如果lpAccount参数指定的帐户名,此参数必须指向要使用的密码当连接到域控制器。否则,此参数必须为NULL。
fRenameOptions [in]
重命名选项。如果这个参数是NETSETUP_ACCT_CREATE,函数重命名域中的帐户。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值可以是下面的错误代码或系统错误代码之一。
返回codeDescription
ERROR_ACCESS_DENIEDAccess被拒绝。返回此错误的帐户名,如果在lpAccount参数传递没有足够的操作权限。
ERROR_INVALID_PARAMETERA参数不正确。
NERR_SetupNotJoinedThe计算机目前没有加入到域。
NERR_SetupDomainControllerThis计算机是一个域控制器,不能从一个域unjoined。
备注
重命名域中的计算机可以执行只能由用户是管理员成员在目标计算机上的本地组,这也是Administrators组的成员或域帐户操作员具有域上的特权。如果调用NetRenameMachineInDomain函数远程,您必须提供凭据,因为您不能在这些情况下委托证书。
不同的过程,或同一进程不同线程,不应该调用同时NetRenameMachineInDomain功能。这种情况可能会留在不一致的状态计算机。
在NERR_SetupNotJoined和NERR_SetupDomainController返回值定义Lmerr.h头文件。这个头文件是自动包含的Lm.h头文件和不应该包括直接。
重新启动系统后,需要调用的操作来完成NetRenameMachineInDomain功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmjoin.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
NetAddAlternateComputerName
NetEnumerateComputerNames
NetRemoveAlternateComputerName
NetSetPrimaryComputerName
SetComputerNameEx
NetUnjoinDomain
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetRenameMachineInDomain Function
The NetRenameMachineInDomain function changes the name of a computer in a domain.
Syntax
C++
NET_API_STATUS NetRenameMachineInDomain(
__in LPCWSTR lpServer,
__in LPCWSTR lpNewMachineName,
__in LPCWSTR lpAccount,
__in LPCWSTR lpPassword,
__in DWORD fRenameOptions
);
Parameters
lpServer [in]
A pointer to a constant string that specifies the DNS or NetBIOS name of the computer on which to call the function. If this parameter is NULL, the local computer is used.
lpNewMachineName [in]
A pointer to a constant string that specifies the new name of the computer. If specified, the local computer name is changed as well. If this parameter is NULL, the function assumes you have already called the SetComputerNameEx function.
lpAccount [in]
A pointer to a constant string that specifies an account name to use when connecting to the domain controller. If this parameter is NULL, the caller's context is used.
lpPassword [in]
If the lpAccount parameter specifies an account name, this parameter must point to the password to use when connecting to the domain controller. Otherwise, this parameter must be NULL.
fRenameOptions [in]
The rename options. If this parameter is NETSETUP_ACCT_CREATE, the function renames the account in the domain.
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 or one of the system error codes .
Return codeDescription
ERROR_ACCESS_DENIEDAccess is denied. This error is returned if the account name passed in the lpAccount parameter did not have sufficient access rights for the operation.
ERROR_INVALID_PARAMETERA parameter is incorrect.
NERR_SetupNotJoinedThe computer is not currently joined to a domain.
NERR_SetupDomainControllerThis computer is a domain controller and cannot be unjoined from a domain.

Remarks
Renaming a domain computer can be performed only by a user that is a member of the Administrators local group on the target computer and that also is a member of the Administrators group on the domain or has the Account Operator privilege on the domain. If you call the NetRenameMachineInDomain function remotely, you must supply credentials because you cannot delegate credentials under these circumstances.
Different processes, or different threads of the same process, should not call the NetRenameMachineInDomain function at the same time. This situation can leave the computer in an inconsistent state.
The NERR_SetupNotJoined and NERR_SetupDomainController return values are defined in the Lmerr.h header file. This header file is automatically included by the Lm.h header file and should not be included directly.
A system reboot is required after calling the NetRenameMachineInDomain function for the operation to complete.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmjoin.h (include Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
Network Management Overview
Network Management Functions
NetAddAlternateComputerName
NetEnumerateComputerNames
NetRemoveAlternateComputerName
NetSetPrimaryComputerName
SetComputerNameEx
NetUnjoinDomain
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370613(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:22:23