Pinging a Server from a Server you are not logged in to

January 30, 2009 at 9:01 AMAndy Schneider

I recently had a unique situation in which I needed to see if 4 different servers could ping a specific IP Address. Very often, we use win32_pingstatus to see if a remote machine is responding or not. But in this case, I needed to know if a remote machine could ping another remote machine. Routing was actually set up so that I could not ping the second remote machine from my laptop.

What’s cool is that you can use the –computername parameter in get-wmiobject when you look at win32_pingstatus.

image

I did change the name in a text editor to remote1 just for the sake of demo and public screen shots.

So if you wanted server remote1 to ping server remote3 you could do something like this:

Get-WmiObject Win32_pingstatus –filter “Address =’remote3’” –computername remote1.

Posted in:

Tags:

Comments (3) -

CTP3 has Test-connection cmdlet that has a source parameter that does exactly this as well as many other useful parameters.  The cmdlet uses WMI as well.  

technet.microsoft.com/en-us/library/dd315259.aspx

Reply

Have a look et Test-Connection (CTP3 ping)

PS > Test-Connection -Destination remote3 -Source remote1

Reply

Albert Widjaja
Albert Widjaja says:

Hi,

When i execute that above command i got an error:

Invalid query
At :line:1 char:13
+ Get-WmiObject <<<<  Win32_pingstatus –filter “Address =’WSUS’” –computername MyDev01

here's the scenario:
logon server with PowerGUI: Server B
I want to test: MyDev01
ping target from above server: WSUS

any idea ?

thanks.

Reply

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading