网站首页  词典首页

请输入您要查询的函数:

 

术语 netgetdcname
释义 NetGetDCName
语法:
C++
NET_API_STATUS NetGetDCName(
__in LPCWSTR servername,
__in LPCWSTR domainname,
__out LPBYTE *bufptr
);
NetGetDCName功能
该NetGetDCName函数返回主域控制器(PDC)的名称。它不会返回指定域的备份域控制器(BDC)的名称。此外,您不能远程这是一个非PDC的服务器功能。
应用程序支持DNS风格的名字,应立即调用DsGetDcName的功能。在这样的环境类型的域控制器有一个多主目录复制的关系。因此,它可能是有利的应用程序使用的DC不是PDC的。您可以调用DsGetDcName的功能找到域中的任何DC; NetGetDCName只返回PDC的名称。
参数
服务器名 [in]
指针常量字符串指定的DNS或NetBIOS的远程服务器上的功能是执行的名称。如果该参数为NULL,则使用本地计算机。
域名 [in]
指针常量字符串,指定域的名称。该域名必须是一个NetBIOS(例如域名,微软)。 NetGetDCName不支持DNS风格的名字(例如,microsoft.com)。如果该参数为NULL,则函数返回的主域控制器的名称。
bufptr [out]
指向一个分配的缓冲区,它接收一个字符串,它指定域的PDC服务器的名称。服务器名称为前缀\\ \\。此缓冲区分配制度,必须使用NetApiBufferFree释放功能。有关更多信息,请参阅网络管理功能,缓冲器和网络管理功能缓冲区长度。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值可以是下面的错误代码之一。
返回codeDescription
NERR_DCNotFoundCould找不到域名在参数中指定的域控制器。
ERROR_BAD_NETPATHThe网络路径未找到。返回此错误,如果计算机在参数中指定的服务器名找不到。
ERROR_INVALID_NAMEThe名称语法是不正确的。返回此错误,如果名称参数中指定的服务器名包含非法字符。
ERROR_NOT_SUPPORTEDThe不支持请求。
备注
没有特殊组成员必须成功地执行NetGetDCName功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmaccess.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
获得功能
DsGetDcName的
NetGetAnyDCName
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetGetDCName Function
The NetGetDCName function returns the name of the primary domain controller (PDC). It does not return the name of the backup domain controller (BDC) for the specified domain. Also, you cannot remote this function to a non-PDC server.
Applications that support DNS-style names should call the DsGetDcName function. Domain controllers in this type of environment have a multi-master directory replication relationship. Therefore, it may be advantageous for your application to use a DC that is not the PDC. You can call the DsGetDcName function to locate any DC in the domain; NetGetDCName returns only the name of the PDC.
Syntax
C++
NET_API_STATUS NetGetDCName(
__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.
domainname [in]
Pointer to a constant string that specifies the name of the domain. The domain name must be a NetBIOS domain name (for example, microsoft). NetGetDCName does not support DNS-style names (for example, microsoft.com). If this parameter is NULL, the function returns the name of the domain controller for the primary domain.
bufptr [out]
Pointer to an allocated buffer that receives a string that specifies the server name of the PDC of 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
NERR_DCNotFoundCould not find the domain controller for the domain specified in the domainname parameter.
ERROR_BAD_NETPATHThe network path was not found. This error is returned if the computer specified in the servername parameter could not be found.
ERROR_INVALID_NAMEThe name syntax is incorrect. This error is returned if the name specified in the servername parameter contains illegal characters.
ERROR_NOT_SUPPORTEDThe request is not supported.

Remarks
No special group membership is required to successfully execute the NetGetDCName function.
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
NetGetAnyDCName
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370420(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:25:35