Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Remote Ping using WMI

Posted on February 8, 2011February 8, 2011 by Alan

One of the interesting things you can do with WMI is to capture ping information between two computers from a third computer without opening a remote command shell (using something like PSExec). I wrote RemotePing.vbs in 2005 and recently validated from a Windows 7 computer querying a remote XP computer.  It can be run interactively, or by using the following syntax:

RemotePing /H:remotehost /T:Target  [/N:number of pings]
Ex: RemotePing /h:MyDC /t:192.168.1.1 /n:4
Ex: remoteping /h:XPWS /t:AnyPC

Note the remote host and target information can be a name or an IP.  The remote host must be running XP or later, and you must have admin rights to run this using WMI.  The output looks like this:

Pinging 10.250.6.101 from BOBSCOMPUTER.MYDOMAIN.COM with 32 bytes of data:

Reply from 10.250.6.101: bytes=32 time=32ms TTL=245
Reply from 10.250.6.101: bytes=32 time=32ms TTL=245
Reply from 10.250.6.101: bytes=32 time=34ms TTL=245
Reply from 10.250.6.101: bytes=32 time=31ms TTL=245

Ping statistics for 10.250.6.101 [10.250.6.101]:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
        Minimum = 31ms, Maximum = 34ms, Average = 32ms

Leave a Reply

You must be logged in to post a comment.

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy