KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Active Script: Check Symantec End Point v11 and 12 def's

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Library
View previous topic :: View next topic  
Author Message
SplanK



Joined: 21 Nov 2007
Posts: 38

PostPosted: Tue Oct 14, 2014 2:16 am    Post subject: Active Script: Check Symantec End Point v11 and 12 def's Reply with quote

I have made a quick script which interrogates the AV definition date for Symantec End Point v11 and v12 anti virus.

The test returns under reply "Last Update: DD/MM/YYYY"
Test will go bad if definitions are older than 1 day old, or if there is no AV file found.

Code:

Option Explicit

const statusAlive       = "Host is alive:"
const statusDead        = "No answer:"
const statusUnknown     = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk          = "Ok:"
const statusBad         = "Bad:"
const statusBadContents = "Bad contents:"

FUNCTION PerformTest()
   Dim VirusDat, oFile, oLine, oUpdateDefDate
   Dim FirstChar, EndChar, NumberofChars
   Dim oFSO
   Set oFSO = CreateObject("Scripting.FileSystemObject")

   VirusDat = "C:\Documents and Settings\All Users\Application Data\Symantec\Symantec Endpoint Protection\CurrentVersion\Data\Definitions\VirusDefs\definfo.dat"
   
   'Maybe AV ver 11?   
   If NOT oFSO.FileExists(VirusDat) Then
      VirusDat = "C:\Program Files\Common Files\Symantec Shared\VirusDefs\definfo.dat"
   End If

   

   If oFSO.FileExists(VirusDat) Then
      Set oFile = oFSO.OpenTextFile(VirusDat)
      Do Until oFile.AtEndofStream
         oLine = oFile.ReadLine
         If InStr(oLine, "CurDefs=") > 0 Then
            FirstChar = InStr(oLine, "CurDefs=") + 8
            EndChar = InStr(FirstChar, oLine, ".")
            NumberofChars = EndChar - FirstChar
            oUpdateDefDate = Mid(oLine, FirstChar, NumberofChars)
            oUpdateDefDate = Mid(oUpdateDefDate, 7, 2) & "/" & Mid(oUpdateDefDate, 5, 2) & "/" & Mid(oUpdateDefDate, 1, 4)
            
            If DateDiff("d", oUpdateDefDate, Now) > 1 Then
               PerformTest = statusBad+"Last Update: " & oUpdateDefDate
            Else
               PerformTest = statusOk+"Last Update: " & oUpdateDefDate
            End If

         End If
      Loop
   Else
         PerformTest = statusBad+"No File"
   End If

      

end Function
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index