Where I work we use a piece of software called Dameware to remotely manage computers on our domain. Through Dameware we are able to get a list of all of the computers that are online and currently connected to the domain.
We are in the process of rolling out new desktop management software that does not provide this feature to us. We need to know the name of a computer when we want to connect to it.
I know how to get a list of the computers that belong to the domain but that also returns computers that may or may not be online. How do I return a list of computers that are currently connected (ie. they have an active network connection) to the domain? I thought about returning a list of computers that belong to the domain and then pinging each one but I think that would be slow and a complete waste of resources.
Have you run in to this problem before and if so, what solutions have worked for you? I would prefer a .NET solution but VB script will work as well. I may end up building a GUI for this that I would distribute to members of our IT team.
If you watch the outbound traffic from DameWare, it just snags all the computer objects from AD and then tries to connect to them via their hostname using NETBIOS.
Thats extremely simple to re-create, no magic involved.
Active directory users and computers will provide you a list of all machine accounts in the domain. Other than in scripts, I've never had to worry about whether a machine is online of offline because the changes I make are done via group policy. For desktop support, if I can't walk the user through telling me his machine name, i've got far bigger problems than how to connect.
--- PREFACE ---
I recognise that this question is aged, but it's still a top result on Google, specifically, when searching "get all online domain computers".
--- SOLUTION ---
One line of PowerShell, and the obligatory ActiveDirectory module - required when working with Active Directory objects, will achieve this.
Despite your assertion that pinging each domain computer would be a slow, resource-intensive process, that is precisely what I am proposing be done. It would certainly be handy if Active Directory kept track of each computer's connectivity status (nevermind the traffic generated by this functionality, that's Microsoft's problem to resolve), but unfortunately it does not.
Simply put, the code below obtains a list of devices from Active Directory, pings each one, records the response (or lack thereof), and displays the list of computers that responded. With PowerShell 7, this is simple, fast and resource-unintensive.
--- CODE ---
Windows PowerShell (i.e. version 5.1):
Output:
The command above, while simple, is likely to be very slow to complete in a production environment. Thus, it is recommended to use PowerShell 7 for its significant improvements to both ICMP management and parallelisation. It can be done with Windows PowerShell, but it is more difficult.
PowerShell 7:
Output:
If you are interested in monitoring device status and considering building a GUI, you might consider a system such as Nagios or Zenss (there are many others, but these two are popular options).
Something as basic as Advanced IP Scanner (http://www.radmin.com/products/utilities/ipscanner.php) should be able to get you this info.
I often will use the MMC console for Computer Management, connect to our file server and check for the users' connection there to get their computer name and IP address for remote support. It's quick and easy and I don't have to walk the user through finding their computer name. If they're connection has timed out or something I just have them click on a networked drive to open the connection.