Because ICMP isn't always an option, I've used WMI to test connectivity. This also helps when the computer may still respond to a ping but the OS is hung. I have a blog entry and function at http://blog.sapien.com/current/2007/4/6/ismanageable.html that might help.
Jeffery Hicks
Microsoft PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
blog: http://blog.SAPIEN.com