#76404 - 2003-08-15 04:20 PM
Re: W32LoveSAN checker
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
this could be modified fairly easily
code:
break on
$ou='LDAP://@domain/CN=Computers,dc=Company,dc=com'
$file=@scriptdir+'\complist.txt' ? $ou ? $file
if not exist($file) $Computers = GetObject($ou) For each $Item in $computers $cn=$Item.name $name=right($cn, len($cn)-3) $=writeprofilestring($file,'notScanned',$name,1) next $computers='' endif
$P2Pclients='BearShare','Morpheus','LimeWire','Kazaa','Grokster','Gator.com','Napster','WinMX','aim95' $notscanned=split(readprofilestring($file,'notScanned',''),chr(10))
for each $item in $notscanned ? $item if wshping($item)[1] >0 $clean=1 for each $app in $P2Pclients ' $app' if keyexist('\\'+$item+'\hklm\SOFTWARE\'+$app) ;or keyexist('\\'+$item+'\hkcu\SOFTWARE\'+$app) or keyexist('\\'+$item+'\hklm\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'+$app) or exist('\\'+$item+'\c$\program files\'+$app) $clean=0 beep $=writeprofilestring($file,$app,$item,@date) endif next if $clean $=writeprofilestring($file,'Clean',$item,1) endif $=writeprofilestring($file,'notScanned',$item,'') else ' offline' endif NEXT
;******************************************************************************************************** FUNCTION WSHPing($Computer,optional $replies) dim $ip, $l, $r, $count, $return, $line ,$pos, $avg if not $replies $replies=1 endif $ip=$computer $Count=0 $shell='%comspec% /c %windir%\system32\ping $Computer -n $replies ' $return=WSHPipe($shell,1) if not @error for each $line in $return select case instr($line,"[") $l=instr($line,"[")+1 $r=instr($line,"]") $ip=substr($line,$l,$r-$l) case instr($line,"reply from") $Count=$Count+1 case instr($line,"Average") $pos=instr($line,"Average")+8 $avg=val(right("$line",len($line)-$pos)) endselect if instr($line,"timed out") $Count=$Count-1 endif next $WSHPing=$ip,$count,$avg else $WSHPing="0.0.0.0","0","0" exit(487) endif ENDFUNCTION ;******************************************************************************************** Function WshPipe($ShellCMD, OPTIONAL $NoEcho) Dim $WshShell, $oExec, $AllOutput, $Exit, $WshExitCode $WshErrorMsg="" $WshShell=CreateObject("WScript.Shell") $oExec=$WshShell.Exec($ShellCMD) While $Exit<>1 Dim $Output Select Case Not $oExec.StdOut.AtEndOfStream $Output=$oExec.StdOut.ReadAll Case Not $oExec.StdErr.AtEndOfStream $Output=$oExec.StdErr.ReadAll $WshErrorMsg = $Output Case 1 $Output=-1 EndSelect If $Output=-1 If $oExec.Status=1 $Exit=1 Endif Else If $NoEcho<>1 ? $Output Endif $AllOutput = $AllOutput + $Output Endif Loop $WshExitCode=$oExec.ExitCode $WshPipe=split($AllOutput,chr(10)) Exit($WshExitCode) EndFunction
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 778 anonymous users online.
|
|
|