Page 1 of 1 1
Topic Options
#135559 - 2005-03-15 11:41 AM Mcafee virusdefintions check
Anonymous
Unregistered


Hello all,

I would like to have a script that checks the currently installed viruspattern on all active PC's in a domain and gives the results in txt file. Retrieving the virus definitions from a single PC is not a problem, but I dont know how to do it for a complete network domain (or IP range). AV program is Mcafee Virusscan Enterprise 7.0.0.

Thx for help !

Top
#135560 - 2005-03-15 01:11 PM Re: Mcafee virusdefintions check
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
search here for mcafee manager

find version 2
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#135561 - 2005-03-15 06:50 PM Re: Mcafee virusdefintions check
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Or search the udf forum for comnetview and/or netview udf's.
And do a remote check (its in the registry) for the DAT version/date and the engine version on all comps found by the above udf's.


Edited by R2D2 (2005-03-15 06:52 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#135562 - 2005-03-15 08:39 PM Re: Mcafee virusdefintions check
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Here is a version that should work for you as far as the information. As far a pulling it and getting it from all the PC in your Domain and putting it into a text file, well you'll need to do some reading and searching in order to understand what all is needed. Rad's McAfee Manager could be one way but don't recall if it exports the data or not. Also something to consider is that not all systems will be reachable at all times so the accuracy of the numbers will always be in question as well without accurate numbers of your current systems.

Code:
Break On

Dim $SO,$McAfeeInfo,$Pause
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')

$McAfeeInfo=GetMcAfeeAV()
If VarType($McAfeeInfo)<>8
?'Product Version '+$McAfeeInfo[0]
?'DAT Number '+$McAfeeInfo[1]
?'Engine '+$McAfeeInfo[2]
?'Product ' + $McAfeeInfo[3]
?'ePO ' + $McAfeeInfo[4]
Else
?'McAfee AV not detected...'
EndIf
Color 'r/w'
?? 'Completed. Press a key to continue...'
Get $Pause

Function GetMcAfeeAV()
Dim $AVMcafee,$Tvd,$PName,$DatNum,$AVEngine,$Product,$Key,$ePO
$AVMcafee = 'HKLM\SOFTWARE\McAfee\VirusScan'
$Tvd = 'HKLM\SOFTWARE\Network Associates\TVD'
$Key = 'HKLM\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent'
$ePO = KeyExist($Key)
If $ePO
$Key = 'HKLM\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\EPOAGENT3000'
$ePO = ReadValue($Key, 'Version')
If Not $ePO $ePO='Unknown' EndIf
Else
$ePO =""
EndIf
Select
Case KeyExist($Tvd+'\VirusScan Enterprise\CurrentVersion')
; VS70 - Works with 7.0, 7.1, 8.0
$PName = 'VirusScan Enterprise'
$DatNum = 'DAT File Version: ' + ReadValue($Tvd+'\VirusScan Enterprise\CurrentVersion','szVirDefVer')
$AVEngine = 'Engine Version: ' + ReadValue($Tvd+'\Shared Components\VirusScan Engine\4.0.xx','szEngineVer')
$Product = 'Product Version: ' + ReadValue($Tvd+'\VirusScan Enterprise\CurrentVersion','szProductVer')
Case KeyExist($Tvd+'\VirusScan')
; VS451
$PName = 'VirusScan 4.51'
$Datnum = 'DAT File Version:=' + SubStr(ReadValue($Tvd+'\Shared Components\VirusScan Engine\4.0.xx','szDatVersion'),5,4)
$AVEngine = 'Engine Version:=' + ReadValue($Tvd+'\Shared Components\VirusScan Engine\4.0.xx','szEngineVer')
$Product = 'Product Version:=' + ReadValue($Tvd+'\VirusScan','szCurrentVersionNumber')
Case KeyExist($Tvd+'\Netshield NT\CurrentVersion')
; NS45
$PName = 'NetShield NT 4.5'
$Datnum = 'DAT File Version:=' + SubStr(ReadValue($Tvd+'\Netshield NT\CurrentVersion','szVirDefVer'),5,4)
$AVEngine = 'Engine Version:=' + ReadValue($Tvd+'\Netshield NT\CurrentVersion','szEngineVer')
$Product = 'Product Version:=' + ReadValue($Tvd+'\Netshield NT\CurrentVersion','szProductVer')
Case KeyExist('HKLM\SOFTWARE\Network Associates\NetShield NT')
; NS403a
$PName = 'NetShield NT 4.03a'
$Datnum = 'DAT File Version:=' + SubStr(ReadValue($AVMcafee,'szVirDefVer'),5,4)
$AVEngine = 'Engine Version:=' + ReadValue($AVMcafee,'szEngineVer')
$Product = 'Product Version:=' + ReadValue($AVMcafee,'szProductVer')
EndSelect
$GetMcAfeeAV = $PName,$DatNum,$AVEngine,$Product,$ePO
EndFunction



Top
#135563 - 2005-03-17 10:09 AM Re: Mcafee virusdefintions check
Anonymous
Unregistered


Thanks a lot for the info ! I've used the following code from Will Hetrick which was very usefull (export not available however):

; Requires the Kixforms.dll to be installed and registered or the corret server and share
; where it can be found. 8 lines down is the variable to set the sserver\share

Break ON
;$=setconsole("minimize")
$=SetConsole("hide")

; to set the kixforms directory in case it is not installed.
$kixformsdir="\\Dc01\netlogon\" ; ***

; *********************** Register Kixforms *************************
:top
If VersionCompare(GetFileVersion("%windir%\system32\kixforms.dll"), "<", "2.3.0.41")
Copy "$kixformsdir\kixforms.dll" %windir%\system32
EndIf
$FORM = CreateObject("Kixtart.FORM")
If NOT $form
Shell 'regsvr32 /s %windir%\system32\kixforms.dll'
GoTo top
EndIf

; *********************** FORM Start ********************************
$Form.ClientWidth = 500
$Form.ClientHeight = 550
$Form.FontName = Verdana
$Form.FontSize = 10
$Form.Text = "NEW McAfee Manager"

$Form.PrintXY(1,15,"Domain:")
$txtArea = $Form.ComboBox
$txtArea.Bounds = 50,10,100,150
$txtArea.Style = 1
$txtArea.DropDownWidth = 450
$txtArea.onClick = "EnumOU()"

$Check = $Form.ToolButton
$Check.Icon = 10
$Check.Bounds = $txtArea.Right + 10,$txtArea.top, 75, 25
$Check.Text = "Check"
$Check.ToolTip = "Check List for McAfee Version"
$Check.OnClick = "Check_Click()"

$update = $Form.ToolButton
$update.Icon = 36
$update.Bounds = $check.Right + 10,$txtArea.top,75,25
$update.Text = "Update"
$update.ToolTip = "Update Selected Clients"
$update.OnClick = "update_Click()"
$update.enabled = 0

$Scan = $Form.ToolButton
$Scan.Icon = 43
$Scan.Bounds = $Update.Right + 10,$txtArea.top,75,25
$Scan.Text = "Scan"
$Scan.ToolTip = "Scan Selected Clients"
$Scan.OnClick = "Scan_Click()"

$Exit = $Form.ToolButton
$Exit.Icon = 9
$Exit.Bounds = $scan.Right + 10,$txtArea.top,75,25
$Exit.Text = "Exit"
$Exit.OnClick = "Quit()"

$List = $Form.ListView()
$List.Bounds = 10,$check.bottom +10,480,$Form.ClientHeight - 200
$List.Sorted = 1
$List.MultiSelect = True
$List.GridLines = True
;$List.View = 3
$List.View = 1
$List.FullRowSelect = True
$List.OnClick = "Single_Click()"
$List.OnDoubleClick = "Double_Click()"

$Form.PrintXY(10,$list.bottom + 10,"Path to Eng:")
$txtsdat = $form.TextBox
$txtsdat.Bounds = 100,$list.bottom + 10,315,20

$sfind = $Form.ToolButton
$sfind.Icon = 5
$sfind.Bounds = $txtsdat.Right + 10,$txtsdat.Top,65,20
$sfind.Text = "Find"
$sfind.OnClick = "sfind()"

$Form.PrintXY(10,$txtsdat.Bottom+10,"Path to DAT:")
$txtxdat = $form.TextBox
$txtxdat.Bounds = 100,$txtsdat.Bottom+10,315,20

$xfind = $Form.ToolButton
$xfind.Icon = 5
$xfind.Bounds = $txtxdat.Right + 10,$txtxdat.Top,65,20
$xfind.Text = "Find"
$xfind.OnClick = "xfind()"

$txtstatus = $form.listBox
$txtstatus.Bounds = $list.Left,$txtxdat.Bottom+10,$list.width,$Form.ClientHeight - ($txtxdat.Bottom +10) -10
$txtstatus.Enabled = 1
;********************************************************************************************
;************** Start the application ... *************
;********************************************************************************************

$NAITVD ="HKEY_LOCAL_MACHINE\Software\Network Associates\TVD"
$vsengine ="$NAITVD\Shared Components\VirusScan Engine\4.0.xx"
$mcupdate ="$NAITVD\Shared Components\McUpdate\CurrentVersion"
$Check.enabled = 0
$Scan.enabled = 0
$txtsdat.text = ReadValue("HKEY_LOCAL_MACHINE\Software\McAfeeManager","Eng")
$txtxdat.text = ReadValue("HKEY_LOCAL_MACHINE\Software\McAfeeManager","xDat")
$txtArea.ListIndex = 0

$objNamespace=GetObject("WinNT:")
For Each $sDom In $objNamespace $TxtArea.Additem ($sDom.Name) Next

$_ = $List.Columns.Add("PC Name")
$_ = $List.Columns.Add("Engine")
$_ = $List.Columns.Add("Dat Version")
$_ = $List.Columns.Add("MacAfee Ver")

For Each $Column In $List.Columns
$Column.Width = ($List.ClientWidth-15) / $List.Columns.Count
Next

$Form.Center
$Form.Show

While $Form.Visible
$= Execute($Form.DoEvents)
Loop
Exit 1

;********************************************************************************************
;************** Start the UDF Section ... *************
;********************************************************************************************
Function EnumOUs($LDAP, $Filter)
Dim $aFilter[0], $pos, $objOU, $i, $j
If $Filter <> 'user'
$Filter = 'computer'
EndIf
$objOU = GetObject($LDAP)
If VarTypeName($objOU)='Object'
$aFilter[0] = $Filter
$objOU.Filter = $aFilter
For Each $item In $objOU
If $item.class = $Filter
$i = $LDAP
EndIf
Next
$aFilter[0] = "organizationalUnit"
$objOU.Filter = $aFilter
For Each $item In $objOU
$Name = $item.Name
$pos = InStrRev($LDAP,"/")
$DN = Left($LDAP,$pos) + $Name + ", " + SubStr($LDAP, $pos+1)
$j = EnumOUs($DN, $Filter)
If $j
If $i
$i = $i +"|"+ $j
Else
$i = $j
EndIf
EndIf
Next
Else
; ? "GetObject COM error: " + @error + " " + @serror
Exit 1
EndIf
$EnumOUs = $i
EndFunction
;*************************************************************************************************************************
Function EnumOU()
Dim $computers, $name, $cn
$area=$txtArea.text
$List.Items.Clear
$checkComplete=0
$Computers = Netviewfulldomain($area)
For Each $Item In $computers
$cn=$Item.name
$Item = $List.Items.Add($item.name)
$item.selected = 1
Next
$check.enabled = 1
$List.SetFocus
$computers=0
EndFunction
;*************************************************************************************************************************
Function Check_Click()
Dim $computer, $p, $eng, $dat
$List.SetFocus
If $List.SelectedItems.Count = 0
For Each $item In $list.items
$item.selected = 1
Next
EndIf
$counter=0
$count=$List.selectedItems.count
For Each $item In $List.selectedItems
$list.listindex=$item.index
$counter=$counter+1
$computer=$Item.text
Status("Checking $computer - $counter of $count")
$p=WSHPing($Computer)
If $p[1]=1
$=FN_check_Mcafee($Computer)
$Mac=$Macver
$eng=$Engver
$dat=$regver
$Item.SubItems(1).Text=$eng
$Item.SubItems(2).Text=$dat
$Item.SubItems(3).Text=$Mac
Else
$Item.SubItems(1).Text="Offline"
$Item.SubItems(2).Text=""
$Item.SubItems(3).Text=""

EndIf
$item.selected = 0
Next
$checkComplete = 1
Status("Check complete")
$List.SetFocus
Double_Click()
EndFunction
;*************************************************************************************************************************
Function Single_Click()
Dim $count
$count=$List.SelectedItems.Count
Status("$count items selected")
If $List.SelectedItems.Count > 0 AND $checkComplete=1
$scan.enabled = 1
If Exist($txtsdat.text) OR Exist($txtxdat.text)
$update.enabled = 1
Else
$update.enabled = 0
EndIf
Else
$scan.enabled = 0
EndIf
EndFunction
;*************************************************************************************************************************
Function Double_Click()
Dim $sdat, $xdat, $edat, $sdatver, $xdatver, $edatver
If $txtsdat.text OR $txtxdat.text
$sdat=validate($txtsdat.text)
If NOT @error
$sdatver = $sdat[2]
EndIf
$xdat=validate($txtxdat.text)
If NOT @error
$xdatver = $xdat[2]
EndIf
For Each $item In $list.Items
Select
; case $Item.SubItems(1).Text = ''
; or $Item.SubItems(2).Text = '' $item.selected = 0
; Case $Item.SubItems(1).Text = 'Offline'
; OR $Item.SubItems(1).Text = 'Unavailable' $item.selected = 0
Case VersionCompare($Item.SubItems(1).Text, "<", $sdatver)
OR VersionCompare($Item.SubItems(2).Text, "<", $xdatver) $item.selected = 1
EndSelect
Next
Single_Click()
EndIf
EndFunction
;*************************************************************************************************************************
Function Update_Click()
Dim $computer, $old, $pass, $file, $exe, $ver, $key, $allowdelay, $item
Dim $arrfile[2]
$scan.enabled = 0
$update.enabled = 0
$check.enabled = 0
$sfind.enabled = 0
$xfind.enabled = 0
$allowdelay = 0
$arrfile[0] = $txtsdat.text
$arrfile[1] = $txtxdat.text
For $pass=0 to 1
$sdat = Validate($arrfile[$pass])
If NOT @error
$file = $sdat[0]
$exe = $sdat[1]
$ver = $sdat[2]
$key = Split("szEngineVer szDatVersion")[$pass]
If Exist("$file\$exe")
For Each $Item In $List.SelectedItems
$computer=$Item.text
If NOT VersionCompare($Item.SubItems($pass+1).Text, ">=", $ver)
AND NOT $Item.SubItems($pass+1).Text='Offline'
AND NOT $Item.SubItems($pass+1).Text='Unavailable'
AND NOT $Item.SubItems($pass+1).Text=''
$allowdelay=1
$Item.SubItems($pass+1).Text="Updating"
Status("Updating $exe on $Computer")
$=EnumProcess("scan32.exe", 1, $Computer)
Status("Updating $exe on $Computer - Copying $exe")
$Item.SubItems($pass+1).Text="Copying"
; Copy '%windir%\kix32.exe' '\\$computer\c$$\winnt'
Copy '$file\$exe' '\\$computer\c$$'
$command='C:\$exe /silent /f'
$=RMTEXEC($computer, $command)
Status("Updating $exe on $Computer - Executing $exe Updater")
$Item.SubItems($pass+1).Text="Executing"
EndIf
Next
If $allowdelay=1
For $delay = 30 to 0 step -1
$txtstatus.removeitem($txtstatus.listcount-1)
Status("Pausing for execution - $delay seconds")
Sleep 1
Next
$allowdelay=0
EndIf
For Each $Item In $List.SelectedItems
$computer=$Item.text
$old=$Item.SubItems($pass+1).Text
If $old="Executing"
Status("Updating $exe on $Computer - removing temp files")
Del "\\$computer\c$$\$$exe"
Status("Updating $Computer - Verifying the update")
$=FN_check_Mcafee($computer)
$Mac=$Macver
$eng=$Engver
$dat=$regver
$Item.SubItems(1).Text=$eng
$Item.SubItems(2).Text=$dat
$Item.SubItems(3).Text=$Mac
$Item.SubItems($pass+1).Text=$dat
If $Item.SubItems($pass+1).Text=$old
Status("Updating $exe on $Computer - Failed")
Else
Status("Updating $exe on $Computer - Succeeded")
EndIf
EndIf
Next
EndIf
EndIf
Next
Status("Update Complete")
$scan.enabled = 1
$update.enabled = 1
$check.enabled = 1
$sfind.enabled = 1
$xfind.enabled = 1
Double_Click()
$List.SetFocus
EndFunction
;*************************************************************************************************************************
Function Scan_Click()
$List.SetFocus
$scan.enabled = 0
$update.enabled = 0
$check.enabled = 0
$sfind.enabled = 0
$xfind.enabled = 0
For Each $item In $List.SelectedItems
If NOT $Item.SubItems(1).Text = '' AND NOT $Item.SubItems(1).Text = 'Offline' AND NOT $Item.SubItems(1).Text = 'Unavailable'
$computer=$Item.text
$=EnumProcess("scan32.exe", 1, $Computer)
$command='"C:\Program Files\Common Files\Network Associates\On Demand Scanner\Scan32\scan32.exe" c: /nosplash /autoscan /uinone /continue /noprompt /clean'
$rex=RMTEXEC($computer, $command)
Status("Executing Scan on $Computer - PID $rex")
EndIf
Next
Status("Force Scan Job Complete")
$scan.enabled = 1
$update.enabled = 1
$check.enabled = 1
$sfind.enabled = 1
$xfind.enabled = 1
EndFunction
;*************************************************************************************************************************
Function sfind()
$FileName = $Form.FileOpenDialog("Find engine.exe Update", ".\", "", "SuperDat|*sdat.exe", 0)
$=Validate($FileName)
$List.SetFocus
EndFunction
;*************************************************************************************************************************
Function xfind()
$FileName = $Form.FileOpenDialog("Find xDat.exe Update", ".\", "", "SuperDat|*.exe", 0)
$=Validate($FileName)
$List.SetFocus
EndFunction
;*************************************************************************************************************************
Function Efind()
$FileName = $Form.FileOpenDialog("Find SDat.exe Update", ".\", "", "SuperDat|*sDat.exe", 0)
$=Validate($FileName)
$List.SetFocus
EndFunction
;*************************************************************************************************************************
Function Validate($FilePath)
$FilePos= InStrRev($FilePath,"\")
$File = Right($FilePath,Len($FilePath)-$FilePos)
$Path = Left($FilePath,$FilePos)
Select
Case Right($File,8)="xdat.exe"
$txtxdat.text = $FilePath
$Ver ="4.0."+Left($File,4)
$= WriteValue("HKEY_LOCAL_MACHINE\Software\McAfeeManager","xDat","$FilePath",REG_SZ)
Status("Found xDat - $ver")
$validate=$Path,$File,$Ver
Case Right($File,7)="eng.exe"
$txtsdat.text = $FilePath
$Ver =SubStr($File,1,1)+"."+SubStr($File,2,1)+"."+SubStr($File,3,2)
$= WriteValue("HKEY_LOCAL_MACHINE\Software\McAfeeManager","Eng","$FilePath",REG_SZ)
Status("Found Engine - $ver")
$validate=$Path,$File,$Ver
Case Left($File,4)="sdat"
$txtxdat.text = $FilePath
$Ver1 = + Left($File,8)
$Ver ="4.0."+Right($Ver1,4)
$= WriteValue("HKEY_LOCAL_MACHINE\Software\McAfeeManager","xDat","$FilePath",REG_SZ)
Status("Found SDat - $ver")
$validate=$Path,$File,$Ver

Case 1
Exit 1
EndSelect
EndFunction
;*************************************************************************************************************************
Function Status($text)
$txtstatus.additem($text)
$txtstatus.listindex=$txtstatus.listcount-1
EndFunction
;*************************************************************************************************************************
Function RMTEXEC($computer, $command)
Dim $Connect
$Connect = GetObject("winmgmts:{impersonationLevel=impersonate}!//$computer/root/cimv2:Win32_Process")
$RMTEXEC = $Connect.Create($Command)
Exit @error
$Connect = 0
EndFunction
;****************************************************************************
Function EnumProcess($exe, optional $terminate, optional $Computer)
Dim $winmgmts, $ExecQuery, $Process, $id
If NOT $computer $computer=@wksta EndIf
$winmgmts="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER"
Select
Case Val($exe)>0
$ExecQuery="select * from Win32_Process where ProcessId='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For Each $Process In $GetObject
If $terminate $=$Process.Terminate EndIf
$EnumProcess = $Process.name
Next
$GetObject=0
Case VarType($exe)=8
$ExecQuery="select * from Win32_Process where Name='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For Each $Process In $GetObject
If $terminate $=$Process.Terminate EndIf
$id=$Process.ProcessId
$EnumProcess = "$Id" + "|" + "$EnumProcess"
Next
$EnumProcess=Left($EnumProcess,Len($EnumProcess)-1)
$GetObject=0
Case 1
Exit 1
EndSelect
EndFunction
;********************************************************************************************************
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
;****************************************************************************
Function VersionCompare($Ver1, $Comparison, $Ver2, OPTIONAL $Limit)
Dim $Ver1Sep, $Ver2Sep, $Ver1A, $Ver2A, $SegIndex
$Limit=0+$Limit
If $Limit=0 OR $Limit>4
$Limit=4
EndIf
$Ver1=''+$Ver1
$Ver2=''+$Ver2
If $Ver1='' OR $Ver2='' OR $Comparison=''
$VersionCompare=''
Return
EndIf
If InStr($Ver1,',')
$Ver1Sep=','
Else
$Ver1Sep='.'
EndIf
If InStr($Ver2,',')
$Ver2Sep=','
Else
$Ver2Sep='.'
EndIf
$Ver1=$Ver1+$Ver1Sep+$Ver1Sep+$Ver1Sep+$Ver2Sep
$Ver2=$Ver2+$Ver2Sep+$Ver2Sep+$Ver2Sep+$Ver2Sep
$Ver1A=Split($Ver1,$Ver1Sep)
ReDim preserve $Ver1A[$Limit-1]
$Ver2A=Split($Ver2,$Ver2Sep)
ReDim preserve $Ver2A[$Limit-1]
$Ver1A[0]=Right(''+'0000'+$Ver1A[0],4)
$Ver2A[0]=Right(''+'0000'+$Ver2A[0],4)
For $SegIndex = 1 to $Limit-1
$Ver1A[$SegIndex]=Left(''+Trim($Ver1A[$SegIndex])+'0000',4)
$Ver2A[$SegIndex]=Left(''+Trim($Ver2A[$SegIndex])+'0000',4)
Next
$Ver1=Join($Ver1A,'.')
$Ver2=Join($Ver2A,'.')
Select
Case InStr($Comparison,'=') AND $Ver1=$Ver2 $VersionCompare=1
Case InStr($Comparison,'<') AND $Ver1<$Ver2 $VersionCompare=1
Case InStr($Comparison,'>') AND $Ver1>$Ver2 $VersionCompare=1
Case 1 $VersionCompare=0
EndSelect
EndFunction

;****************************************************************************
Function netview(optional $domain)
Dim $array[255]
Dim $ReDim $ReDim = 255
Dim $i $i = 0
Dim $j $j = 0
Dim $tempfile $tempfile = "%temp%\netview.tmp"
If $domain
$domain = "/domain:$domain"
EndIf
If Exist("$tempfile")
Del "$tempfile"
EndIf
Shell '%comspec% /c net view $domain >"$tempfile"'
If @error = 0
If Open(10,$tempfile) = 0
For $j = 1 to 5
$line = ReadLine(10) ; skip headings
Next
While @error = 0
$array[$i] = RTrim(SubStr($line,3,InStr($line," ")-1))
$i=$i+1
If $i = $ReDim
$ReDim=$ReDim*2
ReDim preserve $array[$ReDim]
EndIf
$line = ReadLine(10)
Loop
$=Close(10)
;Del "$tempfile"
If $i
ReDim preserve $array[$i-4]
$netview = $array
Exit @error
EndIf
EndIf
EndIf
$netview = 0
Exit @error
EndFunction
;***********************************************************************
Function FN_Check_Mcafee($Computer)

$HKEYTVD = "\\$computer\HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\"
Select
; #### Check if installed Viruscan Enterprise Version 7.0.0.xxx
Case ExistKey($HKEYTVD + "VirusScan Enterprise\CurrentVersion") = 0
$macver = ReadValue($HKEYTVD + "VirusScan Enterprise\CurrentVersion","szProductver")
$regver = ReadValue($HKEYTVD + "VirusScan Enterprise\CurrentVersion","szVirDefVer")
$engver = ReadValue($HKEYTVD + "VirusScan Enterprise\CurrentVersion","szEngineVer")
; #### Check if installed Viruscan Multiplatform version 4.5.x.xxxx
Case ExistKey($HKEYTVD + "VirusScan") = 0
$macver = ReadValue($HKEYTVD + "VirusScan","szCurrentVersionNumber")
$regver = ReadValue($HKEYTVD + "Shared Components\VirusScan Engine\4.0.xx","szDatVersion")
$engver = ReadValue($HKEYTVD + "Shared Components\VirusScan Engine\4.0.xx","szEngineVer")
; #### Check if NetShield 4.5.x.xxxx installed
Case ExistKey($HKEYTVD + "NetShield NT") = 0
$macver = ReadValue($HKEYTVD + "NetShield NT\CurrentVersion","szProductver")
$regver = ReadValue($HKEYTVD + "NetShield NT\CurrentVersion","szVirDefVer")
$engver = ReadValue($HKEYTVD + "NetShield NT\CurrentVersion","szEngineVer")
; #### DEFAULT WHEN AN OUTDATED VERSION OR NO MCAFEE CAN BE FOUND
Case 1
$Macver = "Unavailable"
$REGVER = "Unavailable"
$ENGVER = "Unavailable"
EndSelect
; corrects the Dat Version on different install versions to match the same format.
If $regver > 4000 AND $Regver <> "Unavailable"
$regver = "4.0." + $regver
Else
If $regver < 1
$regver = "4." + SubStr($Regver,1,6)
EndIf
EndIf

EndFunction

;----------------------------------------------------------------------------------------------------------------

Function NetViewFulldomain($Domain)

$Comp=GetObject("WinNT://$Domain")
$Comp.filter="Computer",""
$NetViewFulldomain = $Comp

EndFunction




Top
#135564 - 2005-03-17 12:05 PM Re: Mcafee virusdefintions check
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Mcaffee Manager2 exports

http://www.wheelerfam.com/kixtart/McAfeeManager2.exe

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#135565 - 2006-01-25 07:16 PM Re: Mcafee virusdefintions check
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I'm building a new version of this to use the FTP default update method, instead of providing DAT files.

Any interest?
Any Suggestions?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 641 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.055 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org