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

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?
LVL 9
crescendoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

R_RajeshCommented:
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
g0rathCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Glen A.IT Project ManagerCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Dang123Commented:
Listening
0
crescendoAuthor Commented:
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
DominicCroninCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.