Re: WMI Ping help

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

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

  • Next message: Kirk: "Re: Security woes"
    Date: Thu, 29 Apr 2004 22:51:32 +0200
    
    

    Jonathan Swift wrote:

    > Seen this:
    >
    > strMachines = "atl-dc-01;atl-win2k-01;atl-nt4-01;atl-dc-02"
    > aMachines = split(strMachines, ";")
    > For Each machine in aMachines
    > Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
    > ExecQuery("select * from Win32_PingStatus where address = '"_
    > & machine & "'")
    > For Each objStatus in objPing
    > If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then
    > WScript.Echo("machine " & machine & " is not reachable")
    > End If
    > Next
    > Next
    >
    > on Microsoft's web site.
    >
    > But it says only available on 2003 and XP - what would I need to do to make
    > this work on 2000 ?
    Hi

    You could ping the computers first using ping.exe, take a look at
    the IsConnectible function in the link below.

    http://groups.google.com/groups?selm=ejucKB3FEHA.744%40TK2MSFTNGP09.phx.gbl

    -- 
    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
    

  • Next message: Kirk: "Re: Security woes"

    Relevant Pages

    • Re: Cross Domain Scripting Vulnerability, Javascript
      ... The local computer zone in XP SP2 doesn't have permissions to execute ... >>> Microsoft Internet Explorer file:javascript: Cross Domain Scripting ... The web site has to know the exact path and name of the ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • [Corrected CVE number] Re: Fix available for Sgdynamo
      ... The referenced SecurityTracker report contains the correct number -- it ... > about a cross-site scripting bug in a script called Sgdynamo. ... A remote user can conduct cross-site scripting attacks against ... > from the web site running the Ecometry software and would run in the ...
      (Vuln-Dev)
    • Re: Adding code to create fldr to the "saving embedded graphics" macro??
      ... That original Web site code, wherever it is, it's not written very well... ... Open your Outlook VBA project or whatever project your current code lives ... see Windows Scripting Runtime. ... > Set colAttachments = Nothing ...
      (microsoft.public.outlook.program_vba)
    • Re: writing a vbs script that runs a "ping" command on several servers
      ... "False" value is where ping returns "Unknown host". ... Parsing the output from ping.exe and looking for "TTL=" is the way ... -- 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: "is alive" command?
      ... DNS (ping will return "Request timed out.") ... "False" value is where ping returns "Unknown host". ... if "%connected%" EQU "Y" echo %host% is online ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
      (microsoft.public.windowsxp.general)