MprAdminGetPDCServer function (mprapi.h)

The MprAdminGetPDCServer function retrieves the name of the server with the master User Accounts Subsystem (UAS) from either a domain name or a server name. Either the domain name parameter or the server name parameter may be NULL, but not both.

Syntax

DWORD MprAdminGetPDCServer(
  [in]  LPCWSTR lpszDomain,
  [in]  LPCWSTR lpszServer,
  [out] LPWSTR  lpszPDCServer
);

Parameters

[in] lpszDomain

Pointer to a null-terminated Unicode string that specifies the name of the domain to which the RAS server belongs. This parameter can be NULL if you are running your RAS administration application on a Windows NT/Windows 2000 server that is not participating in a domain. If this parameter is NULL, the lpwsServerName parameter must not be NULL.

[in] lpszServer

Pointer to a null-terminated Unicode string that specifies the name of the Windows NT/Windows 2000 RAS server. Specify the name with leading "\" characters, in the form: \servername. This parameter can be NULL if the lpwsDomain parameter is not NULL.

[out] lpszPDCServer

Pointer to a buffer that receives a null-terminated Unicode string that contains the name of a domain controller that has the user account database. The buffer should be big enough to hold the server name (UNCLEN +1). The function prefixes the returned server name with leading "\" characters, in the form: \servername.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails the return value is one of the following values.

Value Meaning
ERROR_NO_SUCH_DOMAIN
The domain specified is not valid.
NERR_InvalidComputer
The lpwsDomainName parameter is NULL, and lpwsServerName parameter is not valid.
 
 

Remarks

The MprAdminGetPDCServer function can obtain the name of the server with the user accounts database given the name of the RAS server, or the name of the domain in which the RAS server resides. To get the server name, call the GetComputerName function

If the server name specified by lpszServer is part of a domain, The server returned by MprAdminGetPDCServer will be either the primary domain controller or a backup domain controller.

If the server name specified by lpszServer is a stand-alone Windows NT/Windows 2000 server (that is, the server or workstation does not participate in a domain), then the server name itself is returned in the lpszUserAccountServer buffer.

You can then use the name of the user account server in a call to the NetQueryDisplayInformation function to enumerate the users in the user account database. You can also use the server name in calls to the MprAdminUserGetInfo and MprAdminUserSetInfo functions to get and set RAS privileges for a specified user account.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header mprapi.h
Library Mprapi.lib
DLL Mprapi.dll

See also

GetComputerName

MprAdminUserGetInfo

MprAdminUserSetInfo

NetQueryDisplayInformation

RAS Administration Functions

Remote Access Service Administration Reference