Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating Norton Anti-Virus Install and Join

Status
Not open for further replies.

baldhead

Technical User
Apr 27, 2004
111
US
Here is the code I have which I am including in the computer startup script for all my machines. The problem is that it will always run. The first condition to check to see if this file exists is somehow not working and the machine thinks that the file is never there. I have verified that it is on each of the clients running this script. If you can look at my other options as well that would be great. My goal is to make it so that if the VPTray.exe program doesn't exists it will run the savcenrb.exe program that will install Norton behind the schemes, then copy the grc.dat file from the server to the workstations correct spot in order to join the workstation to the Norton Corporate Server. Finally I want it to pause for 5 minutes in order for the client to process the GRC.DAT file and join to the Norton Server. This is all topped off with a reboot using psshutdown. From the code I have what is out of place and what will not process correctly. I really appreciate any help you can provide.

thanks

Code:
[sup]
On Error Resume Next

Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
'Replace the server and share with the server the script is placed on

If Not oFSO.FileExists("%SYSTEMDRIVE%\Program Files\Symantec_Client_Security\Symantec AntiVirus\VPTray.exe") Then
	rc=WSHShell.Run("\\sacaton-dc\UTILS\Packages\NortonAV\savcenrb.exe", 1, True)
	rc=WSHShell.Run("cmd /c copy \\sacaton-dc\vphome\GRC.DAT ""%SYSTEMDRIVE%\Documents and Settings\All Users\Application Data\Symantec\Norton Antivirus Corporate Edition\7.5 /y""", 1, True)
	WScript.sleep 200
	rc=WSHSHell.Run("cmd /c copy \\sacaton-dc\netlogon\psshutdown.exe %SYSTEMROOT%\system32 /y", 1, True)
	rc=WSHShell.Run("cmd /c %systemroot%\system32\psshutdown.exe -r", 1, True)
End If



Set oFSO = Nothing
WScript.Quit(0)
[/sup]
 
Instead of it looking for the file, have it search the registry instead. I wrote a script that will detect what version of the program you were running and would do certain things based on that. Let me know if you need me to find the registry key for you.
 
Yeah, if you can provide code that would be awesome. I want it to do what I have decribed in my first post. I really need that grc.dat file copied over and the computer waiting around 5 minutes, and then rebooting. This will complete the joining to the Symantec Server. thanks for all your help.
 
You can use this to copy the GRC.dat file to your clients. This will switch unmanaged clients to managed.

If you add the GRC.DAT file to the folder from which you are adding the AV Client it will install managed for you.

REM *************************************** Copy GRC.DAT to workstation ************************************

IF NOT EXIST "C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5\grc.dat" copy %logonserver%\sysvol\mydomain.com\scripts\LN\grc.dat "C:\Documents and Settings\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5"

or

IF NOT EXIST "C:\WINNT\Profiles\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5\grc.dat" copy %logonserver%\sysvol\mydomain.com\scripts\LN\grc.dat "C:\WINNT\Profiles\All Users\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5"

David
 
Here'e the reg key that I was using.

strRegValue = WshShell.RegRead("HKLM\Software\Intel\LANDesk\VirusProtect6\CurrentVersion\ProductVersion")

This will read the value for that reg key, and if it matches a particular value (which is the version I was searching for) then it will do things based on that. So in your case, you can just do a IfExists thing and see if it is there; if so, just quit. If not, then you know Norton is not installed and it can do it's thing. Let me know if you need more help...
 
I prefer to do it the way Conan has it. It's more straight forward to me. Except I can't seem to get this to work. Conan, what you have shown is almost identical to what I have in my first post. You are just using a batch file not a vb script. I'm also more keen on using a system variable in the first part of the script so that I know it will work know matter the drive letter. I tried this and couldn't get it to work correctly using a Computer Startup script in Group Policy. That is my goal. If the user doesn't have rights locally on the machine they won't be able to copy the file to this location locally on the machine. Therefore, it must run when the computer starts up.
 
I ended up changing the way I was doing this to a batch file. it ends in .cmd. Everything works execept the final reboot. Does anyone know what I would need to do to get the machine to reboot automatically using psshutdown? I know the syntax is correct but the machine just sits at the Ctrl-Alt-Delete login screen after running this script. Remember, this file is being run through the Group Policy Startup/Shutdown option of the OU all the machines are in.

Code:
@echo off

IF EXIST "%SYSTEMDRIVE%\Program Files\Symantec_Client_Security\Symantec AntiVirus\VPTray.exe" (GOTO END) ELSE (GOTO NORTONINSTALL)

:NORTONINSTALL
copy \\dc\netlogon\tools\sleep.exe "%SYSTEMROOT%\system32" /y
copy \\dc\netlogon\tools\psshutdown.exe "%SYSTEMROOT%\system32" /y
\\dc\SOFTWARE\AntiVirus\savcenrb.exe
"%systemroot%\system32\sleep.exe" 60
copy \\dc\vphome\GRC.DAT "%SYSTEMDRIVE%\Documents and Settings\All Users\Application Data\Symantec\Norton Antivirus Corporate Edition\7.5" /y
"%systemroot%\system32\sleep.exe" 600
"%systemroot%\system32\psshutdown.exe" -r -f
GOTO END



:END

thanks
 
I wrote something similiar for the same purpose - install SAV Corporate version 9. I did not use a GPO though. I did it through a login script. I went about it differently however. My script checked to see if a user was a member of a special. If this was the case, I ran the MSI providing all the switches. But it doesn't appear that you are 'installing' the appliction.
 
so I take it the user had local admin rights to install this program. That is something I don't want to give them, if I don't have to. Also, this does install the norton corporate client version 8.0. The executable that is run is entirely behind the scenes. I just wish that I could get the machine to reboot after the grc.dat file is copied over and sleep runs for 10 minutes. The sleep is necessary because the machine doesn't automatically sync up with the Symantec Server when this file is copied. It generally takes about 6-10 minutes. After this is done I still can't see the computer in the Symantec System Center Console until the machine is rebooted. The psshutdown command I'm using works when logged in, but in this script it either doesn't process it correctly or the sleep command is messing things up. I tried just using the psshutdown command in a startup script and it works fine. It will reboot the machine after it boots.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top