网站首页  词典首页

请输入您要查询的函数:

 

术语 netgetanydcname
释义 NetGetAnyDCName
语法:
C++
NET_API_STATUS NetGetAnyDCName(
__in LPCWSTR servername,
__in LPCWSTR domainname,
__out LPBYTE *bufptr
);
NetGetAnyDCName功能
该NetGetAnyDCName函数返回的是直接由指定的服务器信任域的任何域控制器(DC)的名称。
应用程序支持DNS风格的名字,应立即调用DsGetDcName的功能。此功能可以在任何领域找到任何直流,是否域是直接由指定的服务器信任。
参数
服务器名 [in]
指针常量字符串指定的DNS或NetBIOS的远程服务器上的功能是执行的名称。如果该参数为NULL,则使用本地计算机。有关详细信息,请参阅下面的备注部分。
域名 [in]
指针常量字符串,指定域的名称。如果该参数为NULL,该主域的域控制器的名称使用。有关详细信息,请参阅下面的备注部分。
bufptr [out]
指向一个分配的缓冲区,它接收一个字符串,它指定一个域控制器的服务器名称。服务器名称为前缀\\ \\。此缓冲区分配制度,必须使用NetApiBufferFree释放功能。有关更多信息,请参阅网络管理功能,缓冲器和网络管理功能缓冲区长度。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值可以是下面的错误代码之一。
返回codeDescription
ERROR_NO_LOGON_SERVERSNo域控制器可以找到。
ERROR_NO_SUCH_DOMAINThe指定的域不是一个受信任域。
ERROR_NO_TRUST_LSA_SECRETThe信任关系的客户端被打破了。
ERROR_NO_TRUST_SAM_ACCOUNTThe信任关系的服务器端被打破或密码被打破了。
ERROR_DOMAIN_TRUST_INCONSISTENTThe服务器响应不是指定的域的正确的域控制器。
备注
没有特殊组成员必须成功地执行NetGetAnyDCName功能。
如果服务器名指定一个独立的工作站或独立的服务器,没有域名是有效的。
如果服务器名指定一个工作站是一个域或服务器是一个域的成员,该域名必须在同一个域的服务器名。
如果服务器名指定一个域控制器,域名必须是域的域名,该服务器是一个值得信赖的控制器。在域控制器,这一发现已被调用业务在电话至少一次。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmaccess.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
获得功能
DsGetDcName的
NetGetDCName
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetGetAnyDCName Function
The NetGetAnyDCName function returns the name of any domain controller (DC) for a domain that is directly trusted by the specified server.
Applications that support DNS-style names should call the DsGetDcName function. This function can locate any DC in any domain, whether or not the domain is directly trusted by the specified server.
Syntax
C++
NET_API_STATUS NetGetAnyDCName(
__in LPCWSTR servername,
__in LPCWSTR domainname,
__out LPBYTE *bufptr
);
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. For more information, see the following Remarks section.
domainname [in]
Pointer to a constant string that specifies the name of the domain. If this parameter is NULL, the name of the domain controller for the primary domain is used. For more information, see the following Remarks section.
bufptr [out]
Pointer to an allocated buffer that receives a string that specifies the server name of a domain controller for the domain. The server name is prefixed by \\\\. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths .
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_NO_LOGON_SERVERSNo domain controllers could be found.
ERROR_NO_SUCH_DOMAINThe specified domain is not a trusted domain.
ERROR_NO_TRUST_LSA_SECRETThe client side of the trust relationship is broken.
ERROR_NO_TRUST_SAM_ACCOUNTThe server side of the trust relationship is broken or the password is broken.
ERROR_DOMAIN_TRUST_INCONSISTENTThe server that responded is not a proper domain controller of the specified domain.

Remarks
No special group membership is required to successfully execute the NetGetAnyDCName function.
If servername specifies a stand-alone workstation or a stand-alone server, no domainname is valid.
If servername specifies a workstation that is a member of a domain, or a server that is a member of a domain, the domainname must be in the same domain as servername.
If servername specifies a domain controller, the domainname must be one of the domains trusted by the domain for which the server is a controller. The domain controller that this call finds has been operational at least once during this call.
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
Get Functions
DsGetDcName
NetGetDCName
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370419(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:27:15