Re: Online Test

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 05/09/04


Date: Mon, 10 May 2004 00:18:56 +0200

Al Dunbar [MS-MVP] wrote:

> "Russ_S-K" <anonymous@discussions.microsoft.com> wrote in message
> news:4E960996-C198-477C-931A-0D42E87E4BB9@microsoft.com...
>
>>I was wondering if there is a better test to determine if a PC is online
>
> than the one I am using. Using ping seem to be a rather crude way. Here is
> the code I use:
>
>>iPing = oShell.Run( "cmd /c ping -n 2 -w 50 " & sComputer & _
>>" | find /i ""Reply from"" ", 0, TRUE )
>>If iPing <> 0 Then
>> wScript.Echo sComputer & " is not currently online."
>>End If
>
>
> Almost any method for communicating with a remote computer is going to have
> some issues when the remote computer fails to respond, resulting in even
> more time wasted than waiting for ping responses to time out.
>
> You could write a WMI script, for example. But the nature of the
> communications involved in that scenario is more detailed than a ping, and
> relies more heavily on processing being done by the remote system. I have
> not timed it myself, but I would be surprised if it takes less time for a
> WMI script to determine that a system is not there.
Hi

Using WMI to check if a system is alive is not a good solution (unless
you use the Win32_PingStatus method introduced with WinXP that pings a
computer). WMI uses several minutes to timeout when trying to connect
to an unavailable computer.

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx


Relevant Pages

  • Re: Run command on remote computer
    ... You can e.g. use WMI for this, but to be able to access network resources ... Install Software on a Remote Computer ... couple of command line utilities you might want to try out: ... Microsoft MVP Scripting and WMI, ...
    (microsoft.public.scripting.vbscript)
  • Re: How to copy file(s) using WMI
    ... You could launch a vbscript on the remote computer using ... Win32_Process.Create and let the vbscript map a drive "on the fly" ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: check remote computer name through its IP
    ... Otherwise, either the remote computer does not have WMI installed (older than Windows 2000), WMI is corrupt, or WMI is blocked by a firewall. ... Of course, this assumes the remote computer is online and you have connectivity, which should be the case if you can ping it. ...
    (microsoft.public.scripting.vbscript)
  • Re: Is computer connected to network?
    ... If you run your script on a Windows XP or Windows 2003 Server, ... can use the WMI class Win32_PingStatus to ping a computer. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: objShell.Run
    ... >> I thought you had to use WMI to run it remotely. ... >> objShell.run from a local computer to run it on a remote computer unless ... > Microsoft MVP Scripting and WMI, ...
    (microsoft.public.scripting.vbscript)