Our Newsletter


Subscribe to our Newsletter and we'll keep you notified of new products, giveaways and discounts.

We respect your email privacy and will never sell or share your details with anyone.


Knowledgebase Home | Glossary | Favorites | Contact | Login Knowledgebase Home | Glossary | Favorites | Contact | Login
Search the Knowledgebase Browse by Category
Ping using Windows Powershell
Article Details

Last Updated
23rd of February, 2009

User Opinions (1 vote)
100% thumbs up 0% thumbs down

How would you rate this answer?
Helpful
Not helpful
You can ping hosts from the Windows PowerShell by using the Win32_PingStatus WMI Object.

Get-WmiObject -Class Win32_PingStatus -Filter "Address='127.0.0.1'"

This will produce a lot of mostly unnecessary output, so to format it better, try this option:

Get-WmiObject -Class Win32_PingStatus -Filter "Address='127.0.0.1'" | Select-Object -Property Address,ResponseTime,StatusCode

The output fields you can retrieve from this command are listed below:

Address
- Value of the address requested. The form of the value can be either the hostname ('abc123') or IP address ('10.0.0.2').

BufferSize
- Buffer size sent with the ping command. The default value is 32.

NoFragmentation
- If TRUE, ‘Do not Fragment’ is marked on packets sent. The default is FALSE, not fragmented.

PrimaryAddressResolutionStatus
- Status of the address resolution process. If successful, the value is 0 (zero). Any other value indicates an unsuccessful address resolution.

ProtocolAddress
- Address that the destination used to reply. The default is “”.

ProtocolAddressResolved - Resolved address corresponding to the ProtocolAddress property. The default is “”.

RecordRoute
- How many hops should be recorded while the packet is in route. The default is 0 (zero).

ReplyInconsistency
- Inconsistent reply data is reported. ReplySize - Represents the size of the buffer returned.

ResolveAddressNames
- Command resolves address names of output address values. The default is FALSE, which indicates no resolution.

ResponseTime
- Time elapsed to handle the request.

ResponseTimeToLive
- Time to live from the moment the request is received.

RouteRecord
- Record of intermediate hops.

RouteRecordResolved
- Resolved address that corresponds to the RouteRecord value.

SourceRoute
- Comma-separated list of valid Source Routes. The default is “”.

SourceRouteType
- Type of source route option to be used on the host list specified in the SourceRoute property. If a value outside of the ValueMap is specified, then 0 (zero) is assumed. The default is 0 (zero).

StatusCode - Ping command status codes.

0 Success
11001 Buffer Too Small
11002 Destination Net Unreachable
11003 Destination Host Unreachable
11004 Destination Protocol Unreachable
11005 Destination Port Unreachable
11006 No Resources
11007 Bad Option
11008 Hardware Error
11009 Packet Too Big
11010 Request Timed Out
11011 Bad Request
11012 Bad Route
11013 TimeToLive Expired Transit
11014 TimeToLive Expired Reassembly
11015 Parameter Problem
11016 Source Quench
11017 Option Too Big
11018 Bad Destination
11032 Negotiating IPSEC
11050 General Failure


Timeout
- Time-out value in milliseconds. If a response is not received in this time, no response is assumed. The default is 1000 milliseconds.

TimeStampRecord
- Record of timestamps for intermediate hops.

TimeStampRecordAddress
- Intermediate hop that corresponds to the TimeStampRecord value.

TimeStampRecordAddressResolved
- Resolved address that corresponds to the TimeStampRecordAddress value.

TimeStampRoute
- How many hops should be recorded with timestamp information while the packet is in route. A timestamp is the number of milliseconds that have passed since midnight Universal Time (UT). If the time is not available in milliseconds or cannot be provided with respect to midnight UT, then any time may be inserted as a timestamp, provided the high order bit of the Timestamp property is set to 1 to indicate the use of a non-standard value. The default is 0 (zero).

TimeToLive
- Life span of the ping packet in seconds. The value is treated as an upper limit. All routers must decrement this value by 1. When this value becomes 0 (zero), the packet is dropped by the router. The default value is 80 seconds. The hops between routers rarely take this amount of time.

TypeofService
- Type of service is used. The default value is 0 (zero)

0 Normal
2 Minimize Monetary Cost
4 Maximize Reliability
8 Maximize Throughput
16 Minimize Delay






       
 
  For more information about PowerShell, check out our Windows PowerShell Training Videos
 
  Windows PowerShell Training Videos
 
       



Visitor Comments
No visitor comments posted. Post a comment
Post Comment for "Ping using Windows Powershell"
To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Your Name:
   Email Address:
* Your Comment:
* Enter the code below:
 
Related Articles
No related articles were found.
Attachments
No attachments were found.