Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

C# - Determining client info from Active Directory

Back to Forum: Tech Off
  • User profile image
    SlackmasterK

    I'm working on a few projects that involve networking with Active Directory.  One of the issues I'm having is that I'm having to enter the addresses manually for each of the computers I wish to check for certain things.  Basically, I'm having the program scan a given IP range (via FOR loop combined with string concatenation (i.e. "11.11.0."+ThisNode.ToString())) or pre-programmed list of computer hostnames (As read by a \r\n-delimited text file).

    Is there an efficient way to scan Active Directory for all IP addresses within a given subnet, or for all computer hostnames that begin with a given substring?  Ideally, the result would return an array of IP addresses and/or an array of strings containing hostnames.  Thanks.

  • User profile image
    AndyC

    Why not just enumerate the computer accounts in AD and use those.

  • User profile image
    Rossj

    Just for ref, if AD is not available, you could send ARP requests for the IPs you are interested in (added bonus you get the MAC address).  ARP is a lot less likely to be ignored than ICMP PING although you would be limited to the subnet.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.