# EXAMPLE: c:\scripts\ping-host.ps1 -sourcefile c:\scripts\csv\servers.csv -oufile c:\scripts\logs\logfile.csv # VERSION HISTORY: 1 # VERSION DATE: # VERSION COMMENTS: Tested and Validated # param ( $SourceFile, $OutFile ) Function Ping-Hosts Powershell # NAME: Ping-Host.ps1 # AUTHOR: Joshua Schofield # COMMENT: If using a CSV file, you must have a column named DNSName in order for script to complete. Wirth, Ulm, Germany Const SUCCESS As Long = 1 Dim iIPadr As Long Dim iHopCount As Long Dim iRTT As Long iIPadr = inet_addr ( sIPadr ) Ping = ( GetRTTAndHopCount ( iIPadr, iHopCount, iMaxHops, iRTT ) = SUCCESS ) Debug. Text, 20 ), 4, 3 ) End If Next End Sub Public Function Ping ( sIPadr As String, iMaxHops As Long ) As Boolean ' Based on an article on CodeGuru by Bill Nolde ' Implemented in VBA in Nov 2002 by G. Value, "." ) If UBound ( astr ) = 3 Then cell. UsedRange, Columns ( 1 )) astr = Split ( cell. ( ByVal cp As String ) As Long Sub TestPings () Dim cell As Range Dim astr () As String For Each cell In Intersect ( ActiveSheet. VB.net Option Explicit Private Declare PtrSafe Function GetRTTAndHopCount Lib "iphlpapi.dll" _īyRef iRTT As Long ) As Long Private Declare PtrSafe Function inet_addr Lib "wsock32.dll" _
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |