Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

PING up or down ???

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-02-2008   #1 (permalink)
Shay Levi
Guest


 

Re: PING up or down ???

Try this:

$ping = new-object System.Net.NetworkInformation.Ping
$status = $ping.send($computer)
if($status) {"online"} else {"offline"}

If the computer doesn't havs a corresponding A (host) record in DNS, ping
it by its IP number.


-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic


Quote:

> Helo...
>
> I need one script to verify the state of one host/computer...
>
> I write one old script that use de "ping" command, but have a
> problems if the S.O. have distinct languaje of the original...
>
> Other problem detected if when the host to ping not exists in the
> DNS...
>
> Someone have this scripts ???
>
> Thanks.
>
> Emilio G. Burgoa
> San Juan - Argentina


My System SpecsSystem Spec
Old 01-02-2008   #2 (permalink)
Hal Rottenberg
Guest


 

Re: PING up or down ???

Emilio G. Burgoa wrote:
Quote:

> Helo...
>
> I need one script to verify the state of one host/computer...
http://halr9000.com/article/447

PowerShell Script: Select-Alive
By halr9000
Powershell
Purpose:

Use as a filter to select computers from a stream on which to act upon later in
the pipeline. Example:

get-content servers.txt | select-alive | get-wmiobject `
win32_foo


--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)
My System SpecsSystem Spec
Old 01-02-2008   #3 (permalink)
Emilio G. Burgoa
Guest


 

PING up or down ???

Helo...

I need one script to verify the state of one host/computer...

I write one old script that use de "ping" command, but have a problems if
the S.O. have distinct languaje of the original...

Other problem detected if when the host to ping not exists in the DNS...

Someone have this scripts ???

Thanks.

Emilio G. Burgoa
San Juan - Argentina


My System SpecsSystem Spec
Closed Thread
Update your Vista Drivers Update Your Drivers Now!!

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
I can ping with IPv6. I can not ping with IPv4. Eric Gamess Vista General 2 05-03-2008 03:01 PM
Can ping, but ... em_CT Vista networking & sharing 4 12-05-2007 10:14 AM
Can Only Ping One way Trevor Vista networking & sharing 1 08-14-2007 05:05 PM
Ping....................! Frankster Vista General 7 02-13-2007 06:07 PM
Ping lockup Vista installation & setup 6 02-09-2007 10:15 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51