note
Anonymous Monk
Script did great - only minor modifications needed to keep it running 7 years later! For those who may be interested - I had to change some registry key paths and remove the "engine" check. It was so fast! Worked great with a trimmed-down list from "net view"
<br><br>
here's the modified script:<br><br>
# Lists version, engine, and dat versions for Netshield servers listed in<br># specified infile to the specified outfile. <br># Usage checkdatall.pl [inputfile] [outputfile]<br># The input file should be a text file with one server per line<br># Simple Help can be obtained with or -?<br># Updated on 4.1.09<br> <br>use strict;<br>use Win32::TieRegistry;<br><br>#define variables<br>my ($dat,$ver,$infile,$outfile);<br>if ($ARGV[0]){<br> if ($ARGV[0] eq '-?'){die "Usage checkdatall.pl [infile] [outfile]\n";}<br> $ARGV[0]=~s/\\/\//g;<br> $infile=$ARGV[0];<br>}else{<br> $infile='allservers.txt';<br>}<br><br>if ($ARGV[1]){<br> $ARGV[1]=~s/\\/\//g;<br> $outfile=$ARGV[1];<br>}else{<br> $outfile='checkdatall.log';<br>}<br><br><br><br>open (IN,"<$infile") or die "Can't open file for read";<br>open (OUT,">$outfile") or die "Can't open file for write";<br>#Read the dat file version<br>while (<IN>){<br> chomp;<br> $Registry->Delimiter("/");<br> $ver=$Registry->{"//$_/HKEY_LOCAL_MACHINE/Software/Network Associates/ePolicy Orchestrator/Application Plugins/VIRUSCAN8600//Version"} or print OUT "Can\'t access registry on $_\n";<br> $dat=$Registry->{"//$_/HKEY_LOCAL_MACHINE/Software/Network Associates/ePolicy Orchestrator/Application Plugins/VIRUSCAN8600//DATVersion"} or print OUT "Can\'t access registry on $_\n";<br> print OUT "$_\tVersion:$ver\tDat:$dat\n";<br> print "$_\tVersion:$ver\tDat:$dat\n";<br>}<br>close IN;<br>close OUT;<br><br>
150133
150133
2