Here's another version for using Active Directory and multiple Norton Servers. If you want to re-arrange which clients are managed under which servers by their location in Active Directory, then modify the Select case for organization and server. This should be compatible with NT, 2k, and XP, and Norton 7.03+. It will also log Norton versions across the enterprise by creating null textfiles in a directory structure you specify. Visit the listing at Chef Tech. Tweak before using..
Code:
;===================================
;**** Created with KiXscripts Editor | http://KiXscripts.com ****
;**** Last Modified on 5/19/2004 at 5:08:51 PM by Benjamin Coddington ****
;===================================
;========================NAV=====================================
; This will check for appropriate versions of norton AV and list for me
; everyone on base that does not have the right versions of Norton Installed.
; ~~ 2 June 2002, added additional logging for computers by naming convention.
; -- 7 July 2002, added conversion by AD OU.
Break on
SetConsole("show")
$NavDate = "030225"
$AppDataPath = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common AppData")
$SymantecPath = "\Symantec\Norton AntiVirus Corporate Edition\7.5"
$SysType = "Unknown"
$Logged = 0
$KeyThere = Exist($AppDataPath + $SymantecPath + "\" + $NavDate + ".dte")
$Managed = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion", "RemoteHomeDirectory")
$Domain = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","Domain")
Select
Case $Domain <> "org.domain.com"
? "You are not on the domain!!"
Exit
Case $KeyThere AND $Managed
? "This computer has been converted."
Open(2,"\\MainServer\navlog\Converted\" + @HOSTNAME, 1)
Close(2)
Exit
EndSelect
If @INWIN = 1
$SysType = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")
If $SysType = "LanmanNT" OR $SysType = "ServerNT"
$SysType = "Server"
Exit
EndIf
EndIf
If KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\Symantec\InstalledApps")
$NPath = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Symantec\InstalledApps","NAVNT")
$NVer = GetFileVersion ($NPath + "\vpc32.exe")
$Norton = 1
$NVer4 = SubStr("$NVer",1,4)
Else
$Norton = 0
$NVer4 = 0
EndIf
If $NVer4 < "7.03" ; <- check for NAV 7.03 and if not, display msg
MessageBox (" ***NOTICE***" + Chr(10) + Chr(10) +
"Your Norton Antivirus Program needs to be upgraded to at least Version 7.03!" + Chr(10) +
" Contact your Workgroup Admin to install Norton 7.03" + Chr(10) +
" Your workstation and username will be logged."," AntiVirus Status",4112,0)
Open(1,"\\MainServer\navlog\UncompliantVersions\" + @HOSTNAME + " User=" + @USERID + " Nver=" + $NVer4, 1)
Close(1)
$Logged = "true"
;After grace period activate these next 2 lines
;LOGOFF(1)
;EXIT
EndIf
;Start grc.dat filecopy for users with a compliant version of Norton
If NOT $Logged AND NOT $KeyThere
$ComputerName = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName")
$LDAPpath = GetLDAPpath($ComputerName)
Select
Case InStr($LDAPpath,"Org_A")
$ParentServer = "Server_A"
Case InStr($LDAPpath,"Org_B")
$ParentServer = "Server_B"
Case InStr($LDAPpath,"Org_C")
$ParentServer = "Server_C"
Case InStr($LDAPpath,"Org_D")
$ParentServer = "Server_D"
Case InStr($LDAPpath,"Org_E")
$ParentServer = "Server_E"
Case InStr($LDAPpath,"Org_F")
$ParentServer = "Server_F"
Case 1
$ParentServer = "MainServer"
EndSelect
Select
Case $NVer4 >= "7.10"
Copy "\\$ParentServer\VPLOGON\grc.dat" $AppDataPath + $SymantecPath + "\grc.dat"
$Errortext = @SERROR
Case $NVer4 < "7.10"
$ProgramPath = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion","ProgramFilesDir")
If Exist($ProgramPath)
Copy "\\$ParentServer\VPLOGON\grc.dat" $ProgramPath + "\NAVNT\grc.dat"
Else
Copy "\\$ParentServer\VPLOGON\grc.dat" "C:\Program Files\NAVNT\grc.dat"
EndIf
$Errortext = @SERROR
Case 1
$Errortext = "The script cannot determine grc.dat file copy location."
EndSelect
If $ErrorText = "The operation completed successfully."
Del $AppDataPath + $SymantecPath + "\*.dte"
Open(1,$AppDataPath + $SymantecPath + "\" + $NavDate + ".dte",1)
Close(1)
Open(2,"\\MainServer\navlog\" + $ParentServer + "\Managed\" + @HOSTNAME, 1)
Close(2)
$Logged = "true"
Else
Open(1,"\\MainServer\navlog\" + $ParentServer + "\Errors\" + @HOSTNAME + ".txt", 5)
WriteLine(1,"User=" + @USERID + " Nver=" + $NVer4 + " " + $Errortext + ", The Copy path is " + $ProgramPath + "for 7.03 clients and " + $AppDataPath + $SymantecPath + " for 7.6x clients" + Chr(13) + Chr(10))
WriteLine(1,@DAte + " " + @Time + Chr(13) + Chr(10) + Chr(13) + Chr(10))
Close(1)
$Logged = "true"
EndIf
EndIf
;=============================================================================
Function GetLDAPpath($ComputerName)
;Returns the full LDAP path of a computer object on the org.domain.com domain
If NOT $NTO
$NTO = CreateObject("NameTranslate")
EndIf
$NTO.Init (1,"org.domain.com")
$NTO.Set (3,"ORG-Domain\"+ $ComputerName + "$")
$LDAPname = $NTO.Get (1)
$GetLDAPpath = $LDAPname
EndFunction