Logon Server 
Author Message
 Logon Server

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



Mon, 16 Apr 2001 03:00:00 GMT  
 Logon Server
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-------------


Tue, 17 Apr 2001 03:00:00 GMT  
 Logon Server

This works on NT, but how do you do this on a Windows 95 client.  I need to
get the the name of any domain controller, and I need to get the user's full
name, and I need this app to work on both NT and 95.

Ideas?

Quote:

>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, _



Fri, 20 Apr 2001 03:00:00 GMT  
 Logon Server
I think ADSI can do that.See www.microsoft.com

Marty a crit dans le message

Quote:

>This works on NT, but how do you do this on a Windows 95 client.  I need to
>get the the name of any domain controller, and I need to get the user's
full
>name, and I need this app to work on both NT and 95.

>Ideas?


>>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, _



Sat, 21 Apr 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How can I get logon server name and IP address from logon script using wsh

2. Logon Server...

3. Can't logon server -- please help

4. how to logon server?

5. Logon Server

6. LOGON SERVER

7. Logon Server

8. Logon Server

9. Logon Server

10. Retrieving groups/users of logon server

11. Which api for RAS and Logon Server Detection?

12. Logon Server

 

 
Powered by phpBB® Forum Software