home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
gimli.bioss.sari.ac.uk
/
gimli.bioss.sari.ac.uk.zip
/
gimli.bioss.sari.ac.uk
/
pub
/
misc
/
McAfee8.7.Zip
/
ePOPolicyMigration.exe
/
CABFILE
/
1
/
Policy_Upgrade_Script_For_ePO4.0.sql
< prev
next >
Wrap
Text File
|
2009-09-30
|
61KB
|
1,406 lines
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_Upgrade80To87]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_Upgrade80To87]
GO
CREATE PROCEDURE dbo.VSE_Upgrade80To87
(
@PolicySettingsID INT,
@szPlatform NVARCHAR(50)
)
AS
BEGIN
DECLARE @SectionName NVARCHAR(100)
DECLARE @Value NVARCHAR(1024)
/* ----------------------------------------------------------------------------
[General]
ScanProcessesOnEnable = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'General'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'ScanProcessesOnEnable', @Value
END
/* ----------------------------------------------------------------------------
[General]
dwHeuristicNetCheckSensitivity = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'General'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, dwHeuristicNetCheckSensitivity', @Value
END
/* ----------------------------------------------------------------------------
[Trusted-Action] [Trusted-Action]
uAction = 1 => = 7 (Deny)
uAction = 6 => = 1 (Continue)
uSecAction = 1 => = 7 (Deny)
uSecAction = 6 => = 1 (Continue)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '1'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '1'
END
END
/* ----------------------------------------------------------------------------
[Trusted-Spyware] [Trusted-Spyware]
uAction_Program = 1 => = 7 (Deny)
uAction_Program = 6 => = 1 (Continue)
uSecAction_Program = 1 => = 7 (Deny)
uSecAction_Program = 6 => = 1 (Continue)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '1'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '1'
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Action] [Untrusted-Action]
uAction = 1 => = 7 (Deny)
uAction = 6 => = 1 (Continue)
uSecAction = 1 => = 7 (Deny)
uSecAction = 6 => = 1 (Continue)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '1'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '1'
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Spyware] [Untrusted-Spyware]
uAction_Program = 1 => = 7 (Deny)
uAction_Program = 6 => = 1 (Continue)
uSecAction_Program = 1 => = 7 (Deny)
uSecAction_Program = 6 => = 1 (Continue)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '1'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '1'
END
END
/* ----------------------------------------------------------------------------
[Default-Action] [Default-Action]
uAction = 1 => = 7 (Deny)
uAction = 6 => = 1 (Continue)
uSecAction = 1 => = 7 (Deny)
uSecAction = 6 => = 1 (Continue)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '1'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '1'
END
END
/* ----------------------------------------------------------------------------
[Default-Spyware] [Default-Spyware]
uAction_Program = 1 => = 7 (Deny)
uAction_Program = 6 => = 1 (Continue)
uSecAction_Program = 1 => = 7 (Deny)
uSecAction_Program = 6 => = 1 (Continue)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '1'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 1
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 6
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '1'
END
END
/* ----------------------------------------------------------------------------
[EmailAction] [EmailAction]
dwPromptButton => |= 0x00000020 (Delete Mail)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'EmailAction'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'dwPromptButton', @Value OUTPUT
SET @Value = CONVERT(INT,@Value) | 0x00000020
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'dwPromptButton', @Value
END
/* ----------------------------------------------------------------------------
[EmailNotes]
+NOTES_OAScanServerDataBases = 0
+NOTES_OAScanServerMail = 1
+NOTES_ServerMailFolder = !!mail\
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'EmailDetection'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @SectionName = @szPlatform + 'EmailNotes'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'NOTES_OAScanServerDataBases', '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'NOTES_OAScanServerMail', '1'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'NOTES_ServerMailFolder', '!!mail\'
END
/* ----------------------------------------------------------------------------
[Trusted-Action] [Trusted-Action]
uAction = 3 (Move) => = 4 (Delete)
uSecAction => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '4'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
END
/* ----------------------------------------------------------------------------
[Trusted-Action] [Trusted-Action]
uAction = 5 (Clean)
uSecAction = 3 (Move) => = 4 (Delete)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 5
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '4'
END
END
END
/* ----------------------------------------------------------------------------
[Trusted-Action] [Trusted-Action]
uAction = 4 (Delete)
uSecAction = 3 (Move) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Trusted-Spyware] [Trusted-Spyware]
uAction_Program = 3 (Move) => = 4 (Delete)
uSecAction_Program = 4 (Delete) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '4'
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Trusted-Spyware] [Trusted-Spyware]
uAction_Program = 5 (Clean)
uSecAction_Program = 3 (Move) => = 4 (Delete)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 5
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '4'
END
END
END
/* ----------------------------------------------------------------------------
[Trusted-Spyware] [Trusted-Spyware]
uAction_Program = 4 (Delete)
uSecAction_Program = 3 (Move) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Trusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Action] [Untrusted-Action]
uAction = 3 (Move) => = 4 (Delete)
uSecAction => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '4'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Action] [Untrusted-Action]
uAction = 5 (Clean)
uSecAction = 3 (Move) => = 4 (Delete)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 5
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '4'
END
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Action] [Untrusted-Action]
uAction = 4 (Delete)
uSecAction = 3 (Move) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Spyware] [Untrusted-Spyware]
uAction_Program = 3 (Move) => = 4 (Delete)
uSecAction_Program = 4 (Delete) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '4'
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Spyware] [Untrusted-Spyware]
uAction_Program = 5 (Clean)
uSecAction_Program = 3 (Move) => = 4 (Delete)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 5
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '4'
END
END
END
/* ----------------------------------------------------------------------------
[Untrusted-Spyware] [Untrusted-Spyware]
uAction_Program = 4 (Delete)
uSecAction_Program = 3 (Move) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Untrusted-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Default-Action] [Default-Action]
uAction = 3 (Move) => = 4 (Delete)
uSecAction => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction', '4'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
END
/* ----------------------------------------------------------------------------
[Default-Action] [Default-Action]
uAction = 5 (Clean)
uSecAction = 3 (Move) => = 4 (Delete)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 5
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '4'
END
END
END
/* ----------------------------------------------------------------------------
[Default-Action] [Default-Action]
uAction = 4 (Delete)
uSecAction = 3 (Move) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Action'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Default-Spyware] [Default-Spyware]
uAction_Program = 3 (Move) => = 4 (Delete)
uSecAction_Program = 4 (Delete) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uAction_Program', '4'
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
END
END
/* ----------------------------------------------------------------------------
[Default-Spyware] [Default-Spyware]
uAction_Program = 5 (Clean)
uSecAction_Program = 3 (Move) => = 4 (Delete)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 5
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '4'
END
END
END
/* ----------------------------------------------------------------------------
[Default-Spyware] [Default-Spyware]
uAction_Program = 4 (Delete)
uSecAction_Program = 3 (Move) => = 7 (Deny)
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Default-Spyware'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uAction_Program', @Value OUTPUT
IF @Value = 4
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'uSecAction_Program', @Value OUTPUT
IF @Value = 3
BEGIN
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'uSecAction_Program', '7'
END
END
END
/* ----------------------------------------------------------------------------
[General] [QuarantinePolicy]
szMoveToFolder=\quarantine => szQuarantineDirectory=<SYSTEM_DRIVE>\quarantine
~OR~
szMoveToFolder=C:\quarantine => szQuarantineDirectory=C:\quarantine
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'General'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'szMoveToFolder', @Value OUTPUT
SELECT @SectionName = @szPlatform + 'QuarantinePolicy'
IF @Value LIKE '\%'
BEGIN
SELECT @Value = '<SYSTEM_DRIVE>' + @Value
END
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'szQuarantineDirectory', @Value
SELECT @SectionName = @szPlatform + 'General'
EXEC EPOPolicy_DeletePolicySettingValue 0, @PolicySettingsID, @SectionName, 'szMoveToFolder'
END
/* ----------------------------------------------------------------------------
[Alerting]
-bMoveFiles
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Alerting'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_DeletePolicySettingValue 0, @PolicySettingsID, @SectionName, 'bMoveFiles'
END
/* ----------------------------------------------------------------------------
[Reporting]
-bLogUserName
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Reporting'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_DeletePolicySettingValue 0, @PolicySettingsID, @SectionName, 'bLogUserName'
END
/* ----------------------------------------------------------------------------
[UIPOptions]
UseUTF8=1
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'UIPOptions'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '1'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'UseUTF8', @Value
END
/* ----------------------------------------------------------------------------
[UIPOptions]
UIPPages+='0000'
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'UIPOptions'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @SectionName, 'UIPPages', @Value OUTPUT
SELECT @Value = @Value + '0000'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'UIPPages', @Value
END
/* ----------------------------------------------------------------------------
[EntExclItems]
EnterceptExclusionModule_
EnterceptExclusionAPI_ => EnterceptExclusionModule_.EnterceptExclusionAPI_
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'EntExclItems'
DECLARE @BOPExclusionCursor CURSOR;
SET @BOPExclusionCursor = CURSOR FORWARD_ONLY READ_ONLY FOR
SELECT SectionName, SettingName
FROM EPOPolicySettingValues
WHERE PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName
AND SettingName LIKE 'EnterceptExclusionProcess_%'
OPEN @BOPExclusionCursor;
DECLARE @PolicySectionName NVARCHAR(256)
DECLARE @PolicySettingName NVARCHAR(256)
DECLARE @PolicySettingValue NVARCHAR(1024)
DECLARE @PolicySettingValueCount NVARCHAR(10)
FETCH NEXT FROM @BOPExclusionCursor INTO @PolicySectionName, @PolicySettingName;
WHILE (@@FETCH_STATUS = 0)
BEGIN
SELECT @PolicySettingValue = ''
SELECT @Value = ''
SELECT @PolicySettingValueCount = RIGHT (@PolicySettingName, LEN(@PolicySettingName) - CHARINDEX('_',@PolicySettingName))
SELECT @PolicySettingName = 'EnterceptExclusionModule_' + @PolicySettingValueCount
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @PolicySectionName, @PolicySettingName, @PolicySettingValue OUTPUT
SELECT @PolicySettingName = 'EnterceptExclusionAPI_' + @PolicySettingValueCount
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @PolicySectionName, @PolicySettingName, @Value OUTPUT
IF @PolicySettingValue = ''
OR @PolicySettingValue IS NULL
BEGIN
SELECT @PolicySettingValue = '*'
END
IF @Value = ''
OR @Value IS NULL
BEGIN
SELECT @Value = '*'
END
SELECT @PolicySettingValue = @PolicySettingValue + '.' + @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, @PolicySettingName, @PolicySettingValue
FETCH NEXT FROM @BOPExclusionCursor INTO @PolicySectionName, @PolicySettingName;
END
CLOSE @BOPExclusionCursor;
DEALLOCATE @BOPExclusionCursor;
/* ----------------------------------------------------------------------------
[EntExclItems]
-EnterceptExclusionModule_
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'EntExclItems'
DELETE FROM EPOPolicySettingValues
WHERE PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName
AND SettingName LIKE 'EnterceptExclusionModule_%'
/* ----------------------------------------------------------------------------
[EmailDetection]
dwHeuristicNetCheckSensitivity = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'EmailDetection'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'dwHeuristicNetCheckSensitivity', @Value
END
/* ----------------------------------------------------------------------------
[Alert]
bSendToAlertManagerNetApp = 0
bSendToAlertManagerICAP = 0
bSendToAlertManagerVMODS = 0
bSendToAlertManagerSAP = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Alert'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerNetApp', @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerICAP', @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerVMODS', @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerSAP', @Value
END
END
GO
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_Upgrade85To87]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_Upgrade85To87]
GO
CREATE PROCEDURE dbo.VSE_Upgrade85To87
(
@PolicySettingsID INT,
@szPlatform NVARCHAR(50)
)
AS
BEGIN
DECLARE @SectionName NVARCHAR(100)
DECLARE @Value NVARCHAR(1024)
/* ----------------------------------------------------------------------------
[General]
ScanProcessesOnEnable = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'General'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'ScanProcessesOnEnable', @Value
END
/* ----------------------------------------------------------------------------
[General]
dwHeuristicNetCheckSensitivity = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'General'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, dwHeuristicNetCheckSensitivity', @Value
END
/* ----------------------------------------------------------------------------
[EntExclItems]
EnterceptExclusionModule_
EnterceptExclusionAPI_ => EnterceptExclusionModule_.EnterceptExclusionAPI_
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'EntExclItems'
DECLARE @BOPExclusionCursor CURSOR;
SET @BOPExclusionCursor = CURSOR FORWARD_ONLY READ_ONLY FOR
SELECT SectionName, SettingName
FROM EPOPolicySettingValues
WHERE PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName
AND SettingName LIKE 'EnterceptExclusionProcess_%'
OPEN @BOPExclusionCursor;
DECLARE @PolicySectionName NVARCHAR(256)
DECLARE @PolicySettingName NVARCHAR(256)
DECLARE @PolicySettingValue NVARCHAR(1024)
DECLARE @PolicySettingValueCount NVARCHAR(10)
FETCH NEXT FROM @BOPExclusionCursor INTO @PolicySectionName, @PolicySettingName;
WHILE (@@FETCH_STATUS = 0)
BEGIN
SELECT @PolicySettingValue = ''
SELECT @Value = ''
SELECT @PolicySettingValueCount = RIGHT (@PolicySettingName, LEN(@PolicySettingName) - CHARINDEX('_',@PolicySettingName))
SELECT @PolicySettingName = 'EnterceptExclusionModule_' + @PolicySettingValueCount
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @PolicySectionName, @PolicySettingName, @PolicySettingValue OUTPUT
SELECT @PolicySettingName = 'EnterceptExclusionAPI_' + @PolicySettingValueCount
EXEC EPOPolicy_GetPolicySettingValue @PolicySettingsID, @PolicySectionName, @PolicySettingName, @Value OUTPUT
IF @PolicySettingValue = ''
OR @PolicySettingValue IS NULL
BEGIN
SELECT @PolicySettingValue = '*'
END
IF @Value = ''
OR @Value IS NULL
BEGIN
SELECT @Value = '*'
END
SELECT @PolicySettingValue = @PolicySettingValue + '.' + @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, @PolicySettingName, @PolicySettingValue
FETCH NEXT FROM @BOPExclusionCursor INTO @PolicySectionName, @PolicySettingName;
END
CLOSE @BOPExclusionCursor;
DEALLOCATE @BOPExclusionCursor;
/* ----------------------------------------------------------------------------
[EmailDetection]
dwHeuristicNetCheckSensitivity = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'EmailDetection'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'dwHeuristicNetCheckSensitivity', @Value
END
/* ----------------------------------------------------------------------------
[Alert]
bSendToAlertManagerNetApp = 0
bSendToAlertManagerICAP = 0
bSendToAlertManagerVMODS = 0
bSendToAlertManagerSAP = 0
---------------------------------------------------------------------------- */
SELECT @SectionName = @szPlatform + 'Alert'
IF EXISTS(SELECT *
FROM EPOPolicySettingValues
WHERE EPOPolicySettingValues.PolicySettingsID = @PolicySettingsID
AND SectionName = @SectionName)
BEGIN
SELECT @Value = '0'
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerNetApp', @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerICAP', @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerVMODS', @Value
EXEC EPOPolicy_SetPolicySettingValue 0, @PolicySettingsID, @SectionName, 'bSendToAlertManagerSAP', @Value
END
END
GO
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_UpgradeEnforce]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_UpgradeEnforce]
GO
CREATE PROCEDURE dbo.VSE_UpgradeEnforce
(
@PolicySettingsID INT,
@PolicySettingsTypeID NVARCHAR(256),
@NewFeatureTextID NVARCHAR(50)
)
AS
BEGIN
DECLARE @PolicyObjectID INT
SELECT @PolicyObjectID = EPOPolicyObjectToSettings.PolicyObjectID
FROM EPOPolicyObjectToSettings
WHERE EPOPolicyObjectToSettings.PolicySettingsID = @PolicySettingsID
DECLARE @TypeTextID NVARCHAR(256)
SELECT @TypeTextID = EPOPolicyTypes.TypeTextID
FROM EPOPolicyTypes
WHERE EPOPolicyTypes.TypeID = @PolicySettingsTypeID
DECLARE @NewTypeID INT
SELECT @NewTypeID = EPOPolicyTypes.TypeID
FROM EPOPolicyTypes
WHERE EPOPolicyTypes.TypeTextID = @TypeTextID
AND EPOPolicyTypes.FeatureTextID = @NewFeatureTextID
DECLARE @PolicyObjectName NVARCHAR(256)
SELECT @PolicyObjectName = EPOPolicyObjects.Name
FROM EPOPolicyObjects
WHERE EPOPolicyObjects.PolicyObjectID = @PolicyObjectID
DECLARE @NewPolicyObjectID INT
SELECT @NewPolicyObjectID = EPOPolicyObjects.PolicyObjectID
FROM EPOPolicyObjects
WHERE EPOPolicyObjects.TypeID = @NewTypeID
AND EPOPolicyObjects.Name = @PolicyObjectName
DECLARE @SlotID INT
SELECT @SlotID = 0
SELECT @SlotID = EPOPolicyAssignment.SlotID
FROM EPOPolicyTypes, EPOPolicyObjects, EPOPolicyAssignment
WHERE EPOPolicyTypes.TypeID = @NewTypeID
AND EPOPolicyObjects.TypeID = EPOPolicyTypes.TypeID
AND EPOPolicyAssignment.PolicyObjectID = EPOPolicyObjects.PolicyObjectID
IF (@SlotID > 0)
BEGIN
DECLARE @AssignmentCursor CURSOR;
SET @AssignmentCursor = CURSOR FORWARD_ONLY READ_ONLY FOR
SELECT EPOPolicyAssignment.NodeID, EPOPolicyAssignment.NodeType, EPOPolicyAssignment.ForceInheritance, EPOPolicyAssignment.Hidden, EPOPolicyAssignment.TheTimestamp, EPOPolicyAssignment.TheHiddenTimestamp
FROM EPOPolicyAssignment
WHERE EPOPolicyAssignment.PolicyObjectID = @PolicyObjectID;
OPEN @AssignmentCursor;
DECLARE @NodeID INT
DECLARE @NodeType INT
DECLARE @ForceInheritance INT
DECLARE @Hidden INT
DECLARE @TheTimestamp INT
DECLARE @TheHiddenTimestamp INT
DECLARE @NewAssignmentID INT
FETCH NEXT FROM @AssignmentCursor INTO @NodeID, @NodeType, @ForceInheritance, @Hidden, @TheTimestamp, @TheHiddenTimestamp;
WHILE (@@FETCH_STATUS = 0)
BEGIN
EXECUTE EPOPolicy_AssignPolicyToNode 0, @NewPolicyObjectID, @NodeID, @NodeType, @SlotID, @ForceInheritance, @Hidden, @NewAssignmentID
FETCH NEXT FROM @AssignmentCursor INTO @NodeID, @NodeType, @ForceInheritance, @Hidden, @TheTimestamp, @TheHiddenTimestamp;
END
END
CLOSE @AssignmentCursor;
DEALLOCATE @AssignmentCursor;
END
GO
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_UpgradePolicy]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_UpgradePolicy]
GO
CREATE PROCEDURE dbo.VSE_UpgradePolicy
(
@PolicySettingsID INT,
@PolicySettingsName NVARCHAR(256),
@PolicySettingsTypeID NVARCHAR(256),
@ProductCode NVARCHAR(50),
@NewFeatureTextID NVARCHAR(50)
)
AS
BEGIN
DECLARE @TypeTextID NVARCHAR(256)
SELECT @TypeTextID = EPOPolicyTypes.TypeTextID
FROM EPOPolicyTypes
WHERE EPOPolicyTypes.TypeID = @PolicySettingsTypeID;
DECLARE @PolicyObjectID INT
SELECT @PolicyObjectID = EPOPolicyObjectToSettings.PolicyObjectID
FROM EPOPolicyObjectToSettings
WHERE EPOPolicyObjectToSettings.PolicySettingsID = @PolicySettingsID
DECLARE @UserID INT
SELECT @UserID = 0
SELECT @UserID = UserID
FROM EPOPolicyObjectUserRoles
WHERE EPOPolicyObjectUserRoles.PolicyObjectID = @PolicyObjectID
AND EPOPolicyObjectUserRoles.ACFlags = 1
DECLARE @NewTypeID INT
SELECT @NewTypeID = 0
SELECT @NewTypeID = EPOPolicyTypes.TypeID
FROM EPOPolicyTypes
WHERE EPOPolicyTypes.TypeTextID = @TypeTextID
AND EPOPolicyTypes.FeatureTextID = @NewFeatureTextID
IF (@NewTypeID > 0)
BEGIN
IF (@PolicySettingsName LIKE 'My Default%')
BEGIN
DELETE FROM EPOPolicyObjects
WHERE EPOPolicyObjects.Name = @PolicySettingsName
AND EPOPolicyObjects.TypeID = @NewTypeID
END
DECLARE @NewPolicyObjectID INT
DECLARE @NewPolicySettingsName NVARCHAR(256)
SELECT @NewPolicySettingsName = @PolicySettingsName + ' (VSE 8.7i)'
IF EXISTS(SELECT ePOVersion FROM EPOServerInfo WHERE ePOVersion = '4.0.0')
BEGIN
EXECUTE EPOPolicy_CopyPolicyObject 0, @PolicyObjectID, @NewPolicySettingsName, @UserID, 1, @NewPolicyObjectID OUTPUT
END
ELSE
BEGIN
EXECUTE EPOPolicy_CopyPolicyObject 0, @PolicyObjectID, @NewPolicySettingsName, @UserID, 1, NULL, @NewPolicyObjectID OUTPUT
END
UPDATE EPOPolicyObjects
SET TypeID = @NewTypeID
WHERE PolicyObjectID = @NewPolicyObjectID
IF NOT EXISTS(SELECT * FROM EPOPolicyObjects
WHERE @NewTypeID = TypeID
AND @PolicySettingsName = Name)
BEGIN
UPDATE EPOPolicyObjects
SET Name = @PolicySettingsName
WHERE PolicyObjectID = @NewPolicyObjectID
END
DECLARE @NewPolicySettingsID INT
SELECT @NewPolicySettingsID = EPOPolicyObjectToSettings.PolicySettingsID
FROM EPOPolicyObjectToSettings
WHERE EPOPolicyObjectToSettings.PolicyObjectID = @NewPolicyObjectID
UPDATE EPOPolicySettings
SET TypeID = @NewTypeID
WHERE PolicySettingsID = @NewPolicySettingsID
IF @ProductCode = 'VIRUSCAN8600'
BEGIN
EXECUTE VSE_Upgrade85To87 @NewPolicySettingsID, 'Server_'
EXECUTE VSE_Upgrade85To87 @NewPolicySettingsID, 'Wrkstn_'
END
IF @ProductCode = 'VIRUSCAN8000'
BEGIN
EXECUTE VSE_Upgrade80To87 @NewPolicySettingsID, 'Server_'
EXECUTE VSE_Upgrade80To87 @NewPolicySettingsID, 'Wrkstn_'
END
DECLARE @SlotID INT
SELECT @SlotID = 0
SELECT @SlotID = EPOPolicyAssignment.SlotID
FROM EPOPolicyTypes, EPOPolicyObjects, EPOPolicyAssignment
WHERE EPOPolicyTypes.TypeID = @NewTypeID
AND EPOPolicyObjects.TypeID = EPOPolicyTypes.TypeID
AND EPOPolicyAssignment.PolicyObjectID = EPOPolicyObjects.PolicyObjectID
IF (@SlotID > 0)
BEGIN
DECLARE @AssignmentCursor CURSOR;
SET @AssignmentCursor = CURSOR FORWARD_ONLY READ_ONLY FOR
SELECT EPOPolicyAssignment.NodeID, EPOPolicyAssignment.NodeType, EPOPolicyAssignment.ForceInheritance, EPOPolicyAssignment.Hidden, EPOPolicyAssignment.TheTimestamp, EPOPolicyAssignment.TheHiddenTimestamp
FROM EPOPolicyAssignment
WHERE EPOPolicyAssignment.PolicyObjectID = @PolicyObjectID;
OPEN @AssignmentCursor;
DECLARE @NodeID INT
DECLARE @NodeType INT
DECLARE @ForceInheritance INT
DECLARE @Hidden INT
DECLARE @TheTimestamp INT
DECLARE @TheHiddenTimestamp INT
DECLARE @NewAssignmentID INT
FETCH NEXT FROM @AssignmentCursor INTO @NodeID, @NodeType, @ForceInheritance, @Hidden, @TheTimestamp, @TheHiddenTimestamp;
WHILE (@@FETCH_STATUS = 0)
BEGIN
EXECUTE EPOPolicy_AssignPolicyToNode 0, @NewPolicyObjectID, @NodeID, @NodeType, @SlotID, @ForceInheritance, @Hidden, @NewAssignmentID
FETCH NEXT FROM @AssignmentCursor INTO @NodeID, @NodeType, @ForceInheritance, @Hidden, @TheTimestamp, @TheHiddenTimestamp;
END
CLOSE @AssignmentCursor;
DEALLOCATE @AssignmentCursor;
END
END
END
GO
DECLARE @ProductCode NVARCHAR(30)
DECLARE @DoNotForce80 NVARCHAR(30)
DECLARE @DoNotForce NVARCHAR(30)
SELECT @ProductCode = ''
SELECT @DoNotForce80 = 'DO_NOT_FORCE_80'
SELECT @DoNotForce = 'DO_NOT_FORCE_%'
IF @DoNotForce80 LIKE @DoNotForce
BEGIN
IF EXISTS (SELECT * FROM EPOPolicyTypes
WHERE FeatureTextID = 'VIRUSCAN8600')
BEGIN
SELECT @ProductCode = 'VIRUSCAN8600'
END
ELSE IF EXISTS (SELECT * FROM EPOPolicyTypes
WHERE FeatureTextID = 'VIRUSCAN8000')
BEGIN
SELECT @ProductCode = 'VIRUSCAN8000'
END
END
ELSE
BEGIN
IF EXISTS (SELECT * FROM EPOPolicyTypes
WHERE FeatureTextID = 'VIRUSCAN8000')
BEGIN
SELECT @ProductCode = 'VIRUSCAN8000'
END
END
IF @ProductCode <> ''
BEGIN
DECLARE @PolicyCursor CURSOR;
SET @PolicyCursor = CURSOR FORWARD_ONLY READ_ONLY FOR
SELECT EPOPolicySettings.PolicySettingsID, EPOPolicyObjects.Name, EPOPolicySettings.TypeID
FROM EPOPolicyProductToTypes, EPOPolicySettings, EPOPolicyObjects, EPOPolicyObjectToSettings
WHERE EPOPolicyProductToTypes.TypeID = EPOPolicySettings.TypeID
AND EPOPolicyProductToTypes.TypeID = EPOPolicyObjects.TypeID
AND EPOPolicyObjectToSettings.PolicySettingsID = EPOPolicySettings.PolicySettingsID
AND EPOPolicyObjectToSettings.PolicyObjectID = EPOPolicyObjects.PolicyObjectID
AND EPOPolicyProductToTypes.ProductCode = @ProductCode
AND EPOPolicyProductToTypes.EditURL != 'dummy.htm'
AND EPOPolicyObjects.Name != 'McAfee Default';
OPEN @PolicyCursor;
DECLARE @PolicySettingsID INT
DECLARE @PolicySettingsName NVARCHAR(256)
DECLARE @PolicySettingsTypeID NVARCHAR(256)
FETCH NEXT FROM @PolicyCursor INTO @PolicySettingsID, @PolicySettingsName, @PolicySettingsTypeID;
WHILE (@@FETCH_STATUS = 0)
BEGIN
EXECUTE VSE_UpgradePolicy @PolicySettingsID, @PolicySettingsName, @PolicySettingsTypeID, @ProductCode, 'VIRUSCAN8700'
FETCH NEXT FROM @PolicyCursor INTO @PolicySettingsID, @PolicySettingsName, @PolicySettingsTypeID;
END
CLOSE @PolicyCursor;
DEALLOCATE @PolicyCursor;
DECLARE @EnforceCursor CURSOR;
SET @EnforceCursor = CURSOR FORWARD_ONLY READ_ONLY FOR
SELECT EPOPolicySettings.PolicySettingsID, EPOPolicySettings.TypeID
FROM EPOPolicyProductToTypes, EPOPolicySettings, EPOPolicyObjects, EPOPolicyObjectToSettings
WHERE EPOPolicyProductToTypes.TypeID = EPOPolicySettings.TypeID
AND EPOPolicyProductToTypes.TypeID = EPOPolicyObjects.TypeID
AND EPOPolicyObjectToSettings.PolicySettingsID = EPOPolicySettings.PolicySettingsID
AND EPOPolicyObjectToSettings.PolicyObjectID = EPOPolicyObjects.PolicyObjectID
AND EPOPolicyProductToTypes.ProductCode = @ProductCode
AND EPOPolicyProductToTypes.EditURL = 'dummy.htm'
AND EPOPolicyObjects.Name != 'McAfee Default';
OPEN @EnforceCursor;
FETCH NEXT FROM @EnforceCursor INTO @PolicySettingsID, @PolicySettingsTypeID;
WHILE (@@FETCH_STATUS = 0)
BEGIN
EXECUTE VSE_UpgradeEnforce @PolicySettingsID, @PolicySettingsTypeID, 'VIRUSCAN8700'
FETCH NEXT FROM @EnforceCursor INTO @PolicySettingsID, @PolicySettingsTypeID;
END
CLOSE @EnforceCursor;
DEALLOCATE @EnforceCursor;
END
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_UpgradePolicy]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_UpgradePolicy]
GO
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_UpgradeEnforce]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_UpgradeEnforce]
GO
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_Upgrade85To87]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_Upgrade85To87]
GO
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[VSE_Upgrade80To87]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[VSE_Upgrade80To87]
GO