
August 20th, 2009, 10:37 AM
|
|
|
|
Checking machines on the network with biterscripting
Perhaps, the following script may help. I am going to assume, that machines.txt file is at C:\machines.txt and has one system name per line. Also, that the file you want to check on each system is at C:\file on that system.
Code:
# Script machines.txt
# Get the list of machines.
var str list ; cat "C:\machines.txt" > $list
# Check machines one by one.
var str machine ; lex "1" $list > $machine
while ($machine <> "")
do
# Check the file C:\file on $machine. It is at $machine://C:\file.
af ($machine+"://C:\file") > null
# If the file exists, system variable $fexists is set to true ( bool).
if ( NOT ($fexists) )
# File does not exist. Print machine name.
echo $machine
endif
# Get the next machine.
lex "1" $list > $machine
done
Script is in biterscripting ( http://www.biterscripting.com ) . To use, save the script as C:\Scripts\machines.txt, start biterscripting, enter the following command.
Code:
script machines.txt
To redirect the list of missing machines to missing.txt, use the following.
Code:
script machines.txt > missing.txt
This can also be done in powershell.
|