Skip to content

How to Get Computer Names in a Domain?

Abhi MFC

Asked Mar 11, 2013, 2:13 AM EDT2 answers
Share
LinkedInX
Hi,

Can anyone let me know How can I get the list of computers name  in a Domain in C#.

Thanks
Abhi

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Vishal Gilbile
    0
    Hi there,

    You need to use namespace
    using System.Net; 

     and the following line of code.


    string hostName=Dns.GetHostName();


    With Regards,
    Vishal Gilbile.
    0
  • 0
    Hi Vishal 

    string hostName=Dns.GetHostName();

    Will give our computer name,But I need entire computer names present in the domain.

    Thanks
    Abhi
    0