This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.



Pings all hosts on a specified subnet and returns response information from each host.


  • Ping-Subnet [-Subnet] [-Mask] [-Timeout]


The Ping-Subnet cmdlet sends a ping request to each host on a subnet specified by the user and returns the results. The ping requests are sent sequentially with a default timeout of 200 milliseconds.


  • Subnet Ping all hosts on this subnet. Parameter will accept any IP address on the subnet.
  • Mask The subnet mask for the specified subnet in dotted decimal format, such as
  • Timeout The timeout for each ping request in milliseconds. The default is 200. Valid values are 1 to 3500.


Ping-Subnet does not accept any inputs from the pipeline.


Ping-Subnet outputs an array of Vexasoft.PingResponse objects, each representing the status of a pinged address.


The Ping-Subnet cmdlet requires that DNS services are available to resolve host names.

Example 1

This command will ping all IP addresses on the subnet and return status information for each. The default timeout of 200 milliseconds will be used:

Ping-Subnet -Subnet -Mask

Example 2

As with the above example, this command will ping all IP addresses on the subnet, despite the fact that a host address has been given as the subnet address. You can specify either the base address of a subnet or a host within that subnet when using this cmdlet. All ping requests will still be made via your local computer. This cmdlet does not support pinging from remote computers at this time:

Ping-Subnet -Subnet -Mask

Example 3

This command will ping all IP addresses on the subnet using the maximum timeout of 3500 milliseconds:

Ping-Subnet -Subnet -Mask -Timeout 3500