If I understand, you're trying to get the Primary Domain Controler name.
If this is what you want, below is a function to do it with:
'Returns the pointer
Declare Function NetGetDCName Lib "netapi32.dll" (ByVal lpServerName As
Long, _
ByVal lpDomainName As Long, _
ByRef BuffPtr As Long) As Long
Public Const NERR_Success = 0&
Public Const NERR_BASE = 2100 'NERR_BASE is the base of error codes from
network utilities, chosen to avoid conflict with system and 'redirector
error codes. 2100 is a value that has been assigned to us by system.
Public Const NERR_DCNotFound = (NERR_BASE + 353) 'Could not find domain
controller for this domain.
Public Const ERROR_INVALID_NAME = 123& 'illegal character or
malformed
Here is the explination for the use of above function:
NetGetDCName returns the name of the Primary Domain Controller for the
specified domain.
Security Requirements
No special group membership is required to successfully execute
NetGetDCName.
NET_API_STATUS
NetGetDCName (
LPWSTR servername,
LPWSTR domainname,
LPBYTE * bufptr
);
Parameters:
servername
A pointer to a Unicode string containing the name of the remote server on
which the function is to execute. A NULL pointer or string specifies the
local computer.
domainname
A pointer to a Unicode string containing the name of the domain. A NULL
pointer or string indicates that the name of the domain controller for the
primary domain is to be returned.
bufptr
A pointer to the buffer containing the domain controller name is returned
in the address pointed to by bufptr.
Return Values
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value is one of the following error
codes.
Value
Meaning
NERR_DCNotFound
Could not find the
domain controller for the domain.
ERROR_INVALID_NAME
The name could not be
found.
Hope this helps!
Quote:
> How do I do to know which server " WinNT " that validated my bill of a
> station
> " Win95 and WinNT "? I am using the VB5.
> I have a lot of urgency in knowing of this.
> Thank you,
> Hofner
--
\\~ ~//
----------o00o-(_)-o00o-------------