|
This is the script that I use to setup management upon login of sav 10 clients in this way if they move from site to site they will always be managed and get their updates.
Replace agyxxx with your servername
The messageboxes can be changed to whatever you want for warnings.
$homedir=%windir% $systemdir=$homedir + \SYSTEM32
:checkinstallation $checkinstall=READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion\LiveUpdate\CmdLines\CmdLine4", "ProductVersion") IF $checkversion="" ;Symantec antivirus not installed MessageBox ("Symantec Antivirus is not installed, Please see your techspecialist to get it installed", "Server Compliance Notice") Goto End Else goto checksavverversion ENDIF
:checksavverversion $checksavver=READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion\LiveUpdate\CmdLines\CmdLine4", "ProductVersion") IF $checksavver="8.0" ;Symantec Version 8.0 MessageBox ("Your Symantec Antivirus Version is $checkverupdate, Please see your techspecialist to get upgraded to version 10", "Incorrect version of Symantec Antivirus Detected") Goto End Else ;Symantec version 10.0 ;MessageBox ("Symantec Antivirus Version is $checkverupdate", "Sav Version") ENDIF
:checkappdata $checkappdatapath=READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Common AppData") MessageBox ("Your Application Path is $checkappdatapath", "Application Data Path is")
:checkinstallpath $checkinstallationpath=READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion", "Home Directory") MessageBox ("Your Application Path is $checkinstallationpath", "Home Directory Path is")
:checkdir ;This section checks to see if the local workstation path for the grc exists for symantec 10.0 $workstationfolderpath = "$checkappdatapath\Symantec\Symantec AntiVirus Corporate Edition\7.5" If Exist ($workstationfolderpath) ;MessageBox ("Directory Exists, and is $workstationfolderpath", "Debug") ;now that I have the correct directory structure, I can continue goto checkserver Else MessageBox ("Directory Does not Exist, and is $workstationfolderpath", "Debug") ;what this means is that sav was installed but currently there is no directory structure left. goto end EndIf
:delfiles $grcfile = "grc.dat" $grcfull = $workstationfolderpath + "\" + $grcfile ;MessageBox ("$grcfull", "Grc.dat File Check") If "$workstationfolderpath\$grcfile" ;MessageBox ("File Does Not Exist, and is $workstationfolderpath\$grcfile", "Grc.dat File Check") ELSE ;MessageBox ("File Exists", "Grc.dat File Check") del "$workstationfolderpath\grc.dat" /f ENDIF
:delfiles1 $cerfile = "*.cer" $cerfull = $workstationfolderpath + "\" + $cerfull ;MessageBox ("$cerfile", "cer File Check") ;MessageBox ("$cerfull", "cer File Check") If "$checkinstallationpath\pki\roots\*.cer" ;MessageBox ("File Does Not Exist, and is $checkinstallationpath\pki\roots\*.cer", "*.cer File Check") ELSE ;MessageBox ("File Does Not Exist", "Grc.dat File Check") ;del "$checkinstallationpath\pki\roots\$cerfile" /f ENDIF
:checkserver ;This section will then check if it can see the server \\AGYXXX\vphome directory ;To copy the grc.dat file down (grc.dat should be in \\AGYXXX\vphome $ServerFolderPath = "\\AGYXXX\VPHOME\" If Exist ($ServerFolderPath) ;MessageBox ("Folder exist!", "Debug");if the folder exists then it will commence the copy COPY "\\AGYXXX\vphome\grc.dat" "$checkappdatapath\Symantec\Symantec AntiVirus Corporate Edition\7.5" /r COPY "\\AGYXXX\vphome\*.cer" "$checkinstallationpath\pki\roots" /r ;if it can't find the file it will continue on error Else ;no rights to the server ;MessageBox ("Folder Doesn't Exist!", "Debug") goto end EndIf
:End
|