Getting Domain Controller Name 
Author Message
 Getting Domain Controller Name

Hi All,

I'm writing an app which requires me to get the Domain Controller Name and
any machine accounts that exist on it.  I seem to have trouble with calling
NetGetDCName.

Does anyone have any examples of its use or is there another way to do
this.

Many thanks in advance

Justin.



Fri, 10 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name



Quote:

> Hi All,

> I'm writing an app which requires me to get the Domain Controller Name
and
> any machine accounts that exist on it.  I seem to have trouble with
calling
> NetGetDCName.

This API Declare not in my API 32bit library!!!


Sun, 12 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name


Quote:



>> Hi All,

>> I'm writing an app which requires me to get the Domain Controller Name
>and
>> any machine accounts that exist on it.  I seem to have trouble with
>calling
>> NetGetDCName.
>This API Declare not in my API 32bit library!!!

Declare Function NetGetDCName Lib "NETAPI32.DLL" (ServerName As Byte, DomainName As Byte, DCNPtr As Long) As Long


Mon, 13 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name

Quote:

>>> NetGetDCName.
>>This API Declare not in my API 32bit library!!!

>Declare Function NetGetDCName Lib "NETAPI32.DLL" (ServerName As Byte, DomainName As Byte, DCNPtr As Long) As Long

Thanks...
Is there a call to obtain the user's full name as in NT's user
manager, given you have the obtained the user login ID?




Mon, 13 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name


Quote:
> Declare Function NetGetDCName Lib "NETAPI32.DLL" (ServerName As Byte,

DomainName As Byte, DCNPtr As Long) As Long
Thanks, but makes little sense without sample syntax of call.  ServerName,
is that the PDC or BDC?  How can alphanumerics have a BYTE Data Type? Am I
Supplying the Servername to get the domain name?


Tue, 14 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name

NetUserGetInfo


Quote:
>Is there a call to obtain the user's full name as in NT's user
>manager, given you have the obtained the user login ID?





Fri, 17 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name

Quote:
> Thanks, but makes little sense without sample syntax of call.  ServerName,
> is that the PDC or BDC?  How can alphanumerics have a BYTE Data Type? Am I
> Supplying the Servername to get the domain name?

1. The server name is a byte array because the API is Unicode, therefore will run only
on NT and *not* 95.

Here's an VB example:

Dim Name as String
Dim NArray() As Byte

Name = "John"
NArray = Name & vbNullChar

2. The server name that this API is asking for is the NT domain member server/wrkstn machine name the
function will be executing on, it does not have to be a domain controller.

You can get this by using the GetComputerName ANSI API call.

I suggest that if you don't know a hell of a lot about the Lanman API, Unicode and Win32 architecture that
you don't even attempt using it for production applications.

I good VC reference for this is Win32 Network Programming, Addison Wesley Developers Press.
Otherwise the Win32 SDK is another good source.

I don't know any VB books on this - the reason
being that the B in VB stands for BEGINNERS.



Sat, 18 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name

I always thought it stood for Briskly ?!?

   Briskly Achieved Solutions Impossible in C

:-)

--
Randy Birch, MVP Visual Basic

Moderator, Fidonet Visual Basic Programmer's Conference
VBnet, The Visual Basic Developers Resource Centre
http://home.sprynet.com/sprynet/rasanen/


: I don't know any VB books on this - the reason
: being that the B in VB stands for BEGINNERS.
:



Sun, 19 Mar 2000 03:00:00 GMT  
 Getting Domain Controller Name

Quote:

>I always thought it stood for Briskly ?!?

>   Briskly Achieved Solutions Impossible in C

Nice retort..
Ever wonder what the C people are doing in a VB usergroup?  Salivating
maybe?




Mon, 20 Mar 2000 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Getting Domain Controller Name

2. Returning Domain Name Controller Server

3. Returning Domain Name Controller Server

4. Returning Domain Name Controller Server

5. Getting domain name of parent domain

6. How to List Domain Controllers in domain

7. Getting name from Domain Name Server in VB?

8. Getting the Domain Name

9. Getting user names on NT domain

10. Getting Domain name

11. Getting user names of the same domain.

12. Getting the NETBIOS name of a DNS-style domain

 

 
Powered by phpBB® Forum Software