Usually, when pinging a server IP address we have this in return:
Pinging with 32 bytes of data:
Reply from : bytes=32 time=151 TTL
You can accomplish this with powershell... here is the code you can add to a script
$ping = new-object System.Net.NetworkInformation.Ping
$reply = $ping.send('127.0.0.1')
if ($reply.status -eq "Success"){
[string]::Format("Reply from {0},time={1}",$reply.Address.ToString(),$reply.RoundtripTime)
}else{
$z = [system.net.dns]::gethostaddresses($hostname)[0].ipaddresstostring
[string]::Format("FAIL,{0},{1}",$z,"***")
}
You can format the string in any format you want.