1. Wmic Win32_pingstatus
  2. Pingstatus Mac App
  3. Powershell Ping Status
  4. Ping Statistics Command

A) one thing i did: ping-host 10.40.61.10. Machine answers: Pinging myservername.mydomain 192.168.61.1 with 32 bytes of data: as i mentioned - we focused that there was an mistake in the dns server. PingStatus options: Clicking the small gear opens the Options window for both specific connections and the app (Figure 8). To save a specific set of program settings and ping targets, check the box “Save the application settings.” Figure 8. PingStatus includes settings for both specific connections and the utility as a whole.

Win32_PingStatus
VBScript Code:
WScript.Echo 'www.robvanderwoude.com on-line: ' & Ping( 'www.robvanderwoude.com' )
Function Ping( myHostName )
' This function returns True if the specified host could be pinged.
' myHostName can be a computer name or IP address.
' The Win32_PingStatus class used in this function requires Windows XP or later.
' This function is based on the TestPing function in a sample script by Don Jones
' http://www.scriptinganswers.com/vault/computer%20management/default.asp#activedirectoryquickworkstationinventorytxt
' Standard housekeeping
Dim colPingResults, objPingResult, strQuery
' Define the WMI query
strQuery = 'SELECT * FROM Win32_PingStatus WHERE Address = ' & myHostName & ''
' Run the WMI query
Set colPingResults = GetObject('winmgmts://./root/cimv2').ExecQuery( strQuery )
' Translate the query results to either True or False
For Each objPingResult In colPingResults
If Not IsObject( objPingResult ) Then
Ping = False
ElseIf objPingResult.StatusCode = 0 Then
Ping = True
Else
Ping = False
End If
Next
Set colPingResults = Nothing
End Function
Requirements:
Windows version:XP, Server 2003, or Vista
Network:TCP/IP
Client software:N/A
Script Engine:any
Summarized:Works in Windows XP or later.
Doesn't work in Windows 95, 98, ME, NT 4 or 2000.
[Back to the top of this page]
System Scripting Runtime
VBScript Code:
WScript.Echo 'www.robvanderwoude.com on-line: ' & PingSSR( 'www.robvanderwoude.com' )
Function PingSSR( myHostName )
' This function returns True if the specified host could be pinged.
' myHostName can be a computer name or IP address.
' This function requires the System Scripting Runtime by Franz Krainer
' http://www.netal.com/ssr.htm
' Standard housekeeping
Dim objIP
Set objIP = CreateObject( 'SScripting.IPNetwork' )
If objIP.Ping( myHostName ) = 0 Then
PingSSR = True
Else
PingSSR = False
End If
Set objIP = Nothing
End Function
Requirements:
Windows version:Windows 98, ME, NT 4, 2000, XP, Server 2003 or Vista
Network:TCP/IP
Client software:System Scripting Runtime
Script Engine:any
Summarized:Works in Windows 98 and later with System Scripting Runtime is installed, with any script engine.
[Back to the top of this page]
Hi
within a script i'm trying to ping a host. if it's reachable, the script
can go on.

Wmic Win32_pingstatus


<name>.<fqn> in the following examples is not that what i used .. its a
'magic cap'
Wmic win32_pingstatusPingStatusfor this posting *g*
the script gave me back errors - i tried within the console and found
that there was an error in
the dns server. Okay - we fixed that and before we made an ipconfig

Pingstatus Mac App

/flushdns i tried a little bit.

I expect, that if i use the IP-Adress of the host, a ping should always
work (if the host is up).
I thought so. Its different .. see below ..

Powershell Ping Status

My Question - how is ist possible that if i ping an ip-adress -
powershell resolves the name bound to
it an then back to the wrong ip-adress???

The statuscode was sometimes 11003 (host not reachable) or 0.

My problem - i have trust my programm if it says : sry - host ist not
reachable ..
because its intended to work as an automated script, deleting unised
files ..

....................................................................................
Skriptsniplet
....................................................................................
clear
#---------------------------
function FunTest($TargetHost)
{
$return = Get-WmiObject Win32_PingStatus -filter
'Address='$TargetHost' select protocoladdress, statuscode, responsetime
return ($return.statuscode)
}
#---------------------------
$TargetHost = '10.40.61.10'
#$TargetHost = '<name>'
if (FunTest($TargetHost) -eq 0)
{
Write-Host 'Target ist da'
}
else
{
Write-Host 'Target ist nicht da'
}
....................................................................................
/Skriptsniplet
....................................................................................
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
PS C:Users> $Targethost = '10.40.61.10'
PS C:Users> Get-WmiObject Win32_PingStatus -filter
'Address='$TargetHost' select protocoladdress, statuscode, responsetime
protocoladdress
statuscode responsetime
---------------
---------- ------------
10.40.61.10
0 13

Ping Statistics Command

PS C:Usersthorsten.oeltjen> $Targethost = 'deingfle01'
PS C:Usersthorsten.oeltjen> Get-WmiObject Win32_PingStatus -filter
'Address='$TargetHost' select protocoladdress, statuscode, responsetime
protocoladdress
statuscode responsetime
---------------
---------- ------------
11010
....................................................................................
....................................................................................
PS C:Users> ping-host 10.40.61.10
Pinging <name>.<fqn> [192.168.61.1] with 32 bytes of data:
DestinationHostUnreachable
TimedOut
DestinationHostUnreachable
TimedOut
Ping statistics for <name>.<fqn>:
Packets: Sent = 4 Received = 0 (100% loss)
Approximate round trip time: min = 0ms, max = 0ms, avg = 0ms

PS C:Usersthorsten.oeltjen> ping 10.40.61.10
Pinging <name>.<fqn> [192.168.61.1] with 32 bytes of data:
TimedOut
TimedOut
TimedOut
DestinationHostUnreachable Archangel's prophecy pdf free download.

Ping statistics for <name>.<fqn>:
Packets: Sent = 4 Received = 0 (100% loss)
Approximate round trip time: min = 0ms, max = 0ms, avg = 0ms


PS C:Users> ping.exe 10.40.61.10
Ping wird ausgeführt für 10.40.61.10 mit 32 Bytes Daten:
Antwort von 10.40.61.10: Bytes=32 Zeit=14ms TTL=254
Antwort von 10.40.61.10: Bytes=32 Zeit=4ms TTL=254
Antwort von 10.40.61.10: Bytes=32 Zeit=2ms TTL=254
Antwort von 10.40.61.10: Bytes=32 Zeit=2ms TTL=254

Ping-Statistik für 10.40.61.10:
Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
(0% Verlust),
Ca. Zeitangaben in Millisek.:
Minimum = 2ms, Maximum = 14ms, Mittelwert = 5ms
PS C:Users>
....................................................................................
....................................................................................

⇐ ⇐ ScriptLight
⇒ ⇒ Namagic