Results 1 to 7 of 7

Thread: How to Get Domain Name on Lan using Win32 API's

  1. #1
    Join Date
    Mar 2010
    Posts
    1,937

    How to Get Domain Name on Lan using Win32 API's

    Hello there I am trying to write an application which would bring all the network computers on to a treelist control. The application which I am using is WnetEnumResource API. I am new to this things and hence I need your help. Therefore if any of you knows How to Get Domain Name on Lan using Win32 API's then please share some information which might help me in solving the issue. Thanks in advance.

  2. #2
    Join Date
    Apr 2008
    Posts
    3,424

    Re: How to Get Domain Name on Lan using Win32 API's

    According to me you wont be able to get all the computers in the network under a treelist control. You will only be allowed to see the different domains which are there in the network under a single treelist controls but still there must be some workaround to bring all the computers under one treelist controls.

  3. #3
    Join Date
    Mar 2010
    Posts
    1,937

    Re: How to Get Domain Name on Lan using Win32 API's

    Thanks for replying. I tried different ways in to write the program for getting the all the computers under a single control treelist but only the domains under which the computers are working. I have searched everywhere on the Internet but there is no solution available. Still if anybody knows how to go about it, please help.

  4. #4
    Join Date
    Apr 2008
    Posts
    3,339

    Re: How to Get Domain Name on Lan using Win32 API's

    Try the following modifications in the code and see if it works. In the NetServerEnum with "servertype" parameter change it to SV_TYPE_DOMAIN_ENUM so that all the computers under the domains are visible. Then call NetGetDCName functions on each of these domains to get the full domain names. Now call NetQueryDisplayInformation with level 2 at each of the DCs which are obtained to get computer names of each domains. Hopefully the post helps.

  5. #5
    Join Date
    Mar 2010
    Posts
    1,937

    Re: How to Get Domain Name on Lan using Win32 API's

    The modifications which you suggested really helped me in getting the names of all the computers under different domains under one single Treelist control. Thanks a ton for your help. Now I want to know How To List Local Network Connections with WNetEnumResources? I hope you will be knowing the solution to this too. Any help is highly appreciated.

  6. #6
    Join Date
    Apr 2008
    Posts
    3,339

    Re: How to Get Domain Name on Lan using Win32 API's

    The Wnetenumresources is an API which is developed by Microsoft. You can get all the required information for getting a list of all the devices on the local area network from the official website of Microsoft. The exact configuration for the Wnetenumresource is also provided on the website which will definite help you in solving the issue.

  7. #7
    Join Date
    Mar 2010
    Posts
    1,937

    Re: How to Get Domain Name on Lan using Win32 API's

    Yes the MSDN official website has all the required data for configuring and using the Wnetenumresource API for showing all the computers which are connected on the same network. The information was really helpful in configuring the API.

Similar Threads

  1. Replies: 7
    Last Post: 28-12-2010, 10:05 PM
  2. Replies: 3
    Last Post: 13-07-2010, 04:49 PM
  3. Help with Win32/Faitypelf.B backdoor and Win32/Hamweq.E worm
    By Shaan12 in forum Networking & Security
    Replies: 5
    Last Post: 17-12-2009, 06:58 AM
  4. Win32/SpywareIsolator and Win32/Antivirus2009 information
    By Jesus-Ernesto in forum Networking & Security
    Replies: 5
    Last Post: 13-12-2009, 03:33 AM
  5. Replies: 1
    Last Post: 16-09-2009, 10:11 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,155,814.12679 seconds with 17 queries