If you are a system administrator, you likely perform system maintenance and backups on many computers. Most of these tasks can be done remotely, but only if the systems you are working on are powered on. Prior to beginning your scheduled maintenance, you can run a Visual Basic script that will allow you to ping the machines on your network.
- Skill level:
Other People Are Reading
Things you need
- Network connection to remote machines
- Visual Basic compiler
- List of IP addresses for machines you wish to ping
Create a list of computers based on IP addresses. Enter only the IP addresses and only one per line. Save this list as a text file; for example, save the file as "c:\serverlist.txt"
Create a Visual Basic script that calls the "c:\serverlist.txt" file as a source file. This script will also output the results to the file "c:\output.csv". Use the following code:
dim strInputPath, strOutputPath, strStatus
dim objFSO, objTextIn, objTextOut
strInputPath = "c:\serverlist.txt") '- location of input
strOutputPath = "c:\output.csv") '- location of output
set objFSO = CreateObject("Scripting.FileSystemObject")
set objTextIn = objFSO.OpenTextFile( strInputPath,1 )
set objTextIn = objFSO.CreateTextFile( strOutputPath )
Do until objTextIn.AtEndOfStream = True
strComputer = objTextIn.ReadLine if fPingTest( strComputer ) then strStatus = "UP" else strStatus = "DOWN" end if objTextOut.WriteLine(strComputer & "," & strStatus)
Compile and execute the code. Review the contents of "c:\output.csv".
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for