Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

A fast way to tell if a remote PC is on?

Posted on 2003-11-13
6
Medium Priority
?
281 Views
Last Modified: 2010-05-03
I'm writing a utility to scan lots of systems. Before I try to read their registry and disk drives I need to know whether they are 'on' or 'off'. I've used the www.allapi.net API routines to send a PING, but it still takes 4 - 6 seconds to return if the PC is off, and with a lot of machines that can soak up a lot of time.

In the NT4 Server Manager program, it displays a list of servers and workstations very quickly, with 'unavailable' systems greyed out. How does it do this? Is there an API that returns a system's online status?
0
Comment
Question by:crescendo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 9739965
Hi crescendo,

not very elegant, but you could create a mapped drive to each of those system, then check for the existance of a file in that drive. say you mapped system2's C drive to V: of you system then

if dir("v:\test.txt") = "" then its off else its on


Cheers!

Raj
0
 
LVL 5

Accepted Solution

by:
g0rath earned 2000 total points
ID: 9740072
Here is a link on how to get the server list by type
http://www.devcity.net/forums/faq.asp?fid=9&cat=Networking&#TID1712

And here is how to write a local ping which may be faster then the method your using
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20724190.html

AlbertaBeef talks about using your ICMP from ALLAPI, but has a method to look for C:\My Folder and if exists do something...this may be faster then a ping
0
 
LVL 13

Expert Comment

by:AlbertaBeef
ID: 9744790
Yup, I use the ICMP ping you linked him too.  It works great.  500ms (1/2 second) timeout tells you the pc isn't there.  

You should find it works well for you, also.  I use this particular method on an application that checks 1200 workstations to ensure virus definitions are up to date.  Even with the other things I do, it scans 1200 machines and what's on and what's not and updates any out of date definitions in about 10 minutes flat.  So it's pretty quick.

1/2 second beats 4 to 6 seconds hands down . . .

Just a question though, what call are you using to get your list of workstations?  Depending on the method you may be getting names that aren't in use, and that would slow it down as you try to resolve the hostname to an IP.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:Dang123
ID: 9747814
Listening
0
 
LVL 9

Author Comment

by:crescendo
ID: 9749256
Hi all

Sorry for the delay in replying, been off site.

I'll try the ping utility, 500mS would be fine.

I get the list of machines in the domain through ADSI, and yes, it includes systems that don't exist but still have machine accounts. I've just been experimenting with the NetServerEnum (I think that was the right name) API and it's much faster and only seems to list machines that are online at the moment. I believe it gets the list from the master browser, which explains how it knows who is 'on' at the time. I think that if I combine this API with the results from ADSI and the fast ping, I should have a solution. (I still need the ADSI list so that I can see who didn't get updated because the machine was unavailable at the time, and need to ping in case the machine goes off after I get the list).

I'll let you know how I get on.

Thanks folks
0
 
LVL 6

Expert Comment

by:DominicCronin
ID: 9750659
Have a look for some "hacker" tools. Looking for machines that are "up" is a basic requirement for hackers, and there are many "port scanner" available for free download that are highly optimised for gathering a lot of information in a short time.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question