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 / 71To87_Policy_Upgrade_Script.sql next >
Text File  |  2007-10-05  |  97KB  |  3,031 lines

  1. -------------------------------------------------------------------------------
  2.  
  3. ------------  V S E  7 . 1  T O  8 . 7  P O L I C Y  U P G R A D E  -----------
  4.  
  5. -------------------------------------------------------------------------------
  6.  
  7. if exists (select * from tempdb..sysobjects where name like '#VirusScanPolicyIDs%')
  8. drop table #VirusScanPolicyIDs
  9. go
  10.  
  11. /* ----------------------------------------------------------------------------
  12. Copy over 7.1.0 policies to 8.7.0 policies only if non global 8.0.0, 8.5.0 and
  13. 8.7.0 policies don't exist.
  14. ---------------------------------------------------------------------------- */
  15. if not exists (select * from PolicySettings, Policy 
  16.     where PolicySettings.ParentID = Policy.AutoID 
  17.         and ProductCode = 'VIRUSCAN8000' and parentType != 7)
  18.     and not exists (select * from PolicySettings, Policy 
  19.         where PolicySettings.ParentID = Policy.AutoID 
  20.             and ProductCode = 'VIRUSCAN8600' and parentType != 7)
  21.     and not exists (select * from PolicySettings, Policy 
  22.         where PolicySettings.ParentID = Policy.AutoID 
  23.             and ProductCode = 'VIRUSCAN8700' and parentType != 7)
  24. begin
  25.  
  26. /* ----------------------------------------------------------------------------
  27. Copy all non global policy table 7.1.0 policies to 8.7.0 policies.
  28. ---------------------------------------------------------------------------- */
  29. insert Policy
  30. (ParentID, ParentType, ProductCode)
  31. select ParentID, ParentType, 'VIRUSCAN8700'
  32. from Policy
  33. where
  34. Policy.ProductCode = 'VIRUSCAN7100'
  35. and Policy.ParentType in (6, 5, 4, 3, 1)
  36.  
  37. /* ----------------------------------------------------------------------------
  38. Get policy.autoids of all 7.1.0 and 8.7.0 policies.
  39. ---------------------------------------------------------------------------- */
  40. select a.AutoID as AutoID2, b.AutoID as AutoID3
  41. into #VirusScanPolicyIDs
  42. from Policy a, Policy b
  43. where
  44. a.ProductCode = 'VIRUSCAN7100'
  45. and b.ProductCode = 'VIRUSCAN8700'
  46. and a.ParentType = b.ParentType
  47. and a.ParentID = b.ParentID
  48. and a.ParentType in (6, 5, 4, 3, 1)
  49.  
  50. /* ----------------------------------------------------------------------------
  51. Copy all non global PolicySetting from 7.1.0 policy settings to 8.7.0 policy
  52. settings.
  53. ---------------------------------------------------------------------------- */
  54. insert PolicySettings
  55. (ParentID, SectionName, SettingName, Value)
  56. select #VirusScanPolicyIDs.AutoID3, SectionName, SettingName, Value
  57. from PolicySettings, #VirusScanPolicyIDs
  58. where
  59. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  60.  
  61. /* ----------------------------------------------------------------------------
  62.  Change the SectionName and/or the SettingName of the policies that have moved.
  63.  A "-" sign indicates that the value is no longer used and is to be deleted only.
  64.  
  65. OLD VALUE:                                                        NEW VALUE:
  66. [Trusted-Advanced]                                                [Trusted-Spyware]
  67. DetectPrograms                                = 1                =>    DetectPotentiallyUnwantedApps=1
  68. DetectJokes                                    = 1                =>    DetectJokes=1
  69.  
  70. [Untrusted-Advanced]                                            [Untrusted-Spyware]
  71. DetectPrograms                                = 1                =>    DetectPotentiallyUnwantedApps=1
  72. DetectJokes                                    = 1                =>    DetectJokes=1
  73.  
  74. [Default-Advanced]                                                [Default-Spyware]
  75. DetectPrograms                                = 1                =>    DetectPotentiallyUnwantedApps=1
  76. DetectJokes                                    = 1                =>    DetectJokes=1
  77.  
  78. [Trusted-Action]                                                [Trusted-Action]
  79. uAction                                        = 1                =>  = 7 (Deny)
  80. uAction                                        = 6                =>  = 1 (Continue)
  81. uSecAction                                    = 1                =>  = 7 (Deny)
  82. uSecAction                                    = 6                =>  = 1 (Continue)
  83.  
  84. [Untrusted-Action]                                                [Untrusted-Action]
  85. uAction                                        = 1                =>  = 7 (Deny)
  86. uAction                                        = 6                =>  = 1 (Continue)
  87. uSecAction                                    = 1                =>  = 7 (Deny)
  88. uSecAction                                    = 6                =>  = 1 (Continue)
  89.  
  90. [Default-Action]                                                [Default-Action]
  91. uAction                                        = 1                =>  = 7 (Deny)
  92. uAction                                        = 6                =>  = 1 (Continue)
  93. uSecAction                                    = 1                =>  = 7 (Deny)
  94. uSecAction                                    = 6                =>  = 1 (Continue)
  95.  
  96. TODO:
  97. [Trusted-Advanced]
  98. -bScanCompressed???                                                None
  99.  
  100. [Untrusted-Advanced]
  101. -bScanCompressed???                                                None
  102.  
  103. [Default-Advanced]
  104. -bScanCompressed???                                                None
  105.  
  106. [EmailDetection]                                                [EmailDetection]
  107. ExtensionFilterOption (AllFiles)             = 0x00000001     =>     ExtensionMode=1
  108.                       (Default)             = 0x00000002     =>    ExtensionMode=3
  109.                       (Specified)            = 0x00000004     =>    ExtensionMode=4
  110.  
  111. dwDetect (Default + Macros)                    = 0x00001000     =>    ExtensionMode=2
  112.  
  113. [EmailAdvanced]                                                    [EmailAdvanced]
  114. dwDetectOptions (ProgramHeuristics)            = 0x00000008    =>    dwProgramHeuristicsLevel=1
  115. dwDetectOptions    (MacroHeuristics)            = 0x00000004    =>    dwMacroHeuristicsLevel=1
  116. dwDetectOptions    (ScanArchive)                = 0x00000800    =>    ScanArchives=1
  117. dwDetectOptions    (ScanCompressedEXE)            = 0x00000010    =>    bScanCompressed=1
  118. dwDetectOptions    (ScanMIME)                    = 0x00010000    =>    ScanMime=1
  119.  
  120. AdvancedFilterOption (ScanBody)                = 0x00000008    =>    ScanMessageBodies=1
  121. AdvancedFilterOption (MultiExtensionScan)    = 0x00000010    =>    MultipleExtensionsHeuristic
  122.  
  123. [EmailAdvanced]                                                    [EmailSpyware]
  124. dwDetectOptions    (DontDetectJokes)            = 0x00002000    =>    !DetectJokes=1
  125. dwDetectOptions    (DetectPrograms)            = 0x00004000    =>    DetectPotentiallyUnwantedApps=1
  126.  
  127. [EmailAction]                                                    [EmailAction]
  128. uScanAction                                                    =>    uAction
  129. uSecScanAction                                                =>    uSecAction
  130.  
  131.                                             // old actions    =>    // new actions
  132.                                             {                    {
  133.                                                 ACTION_PROMPT=0,    ACTION_CONTINUE=1,
  134.                                                 ACTION_MOVE,        ACTION_PROMPT,
  135.                                                 ACTION_DELETE,        ACTION_MOVE,
  136.                                                 ACTION_CONTINUE,    ACTION_DELETE, 
  137.                                                 ACTION_CLEAN        ACTION_CLEAN,
  138.                                             }                    }        
  139.                                                                                         
  140. dwPromptButton                                                =>    |= 0x00000020 (Delete Mail)
  141.                                             
  142. -szSecMoveFolder                                                None
  143. -dwPromptButton2                                                None
  144.                                             
  145. [EmailReport]                                                    [EmailReport]
  146. uMaxKilobytes                                                =>    dwMaxLogSizeMB
  147.  
  148. [UIOptions]
  149. -dwConsoleRefreshRate                                            None
  150.  
  151. [Trusted-Action]                                                [Trusted-Action]
  152. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  153. uSecAction                                                    =>  = 7 (Deny)
  154.  
  155. [Trusted-Action]                                                [Trusted-Action]
  156. uAction                                        = 5    (Clean)
  157. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  158.  
  159. [Trusted-Action]                                                [Trusted-Action]
  160. uAction                                        = 4    (Delete)
  161. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  162.  
  163. [Untrusted-Action]                                                [Untrusted-Action]
  164. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  165. uSecAction                                                    =>  = 7 (Deny)
  166.  
  167. [Untrusted-Action]                                                [Untrusted-Action]
  168. uAction                                        = 5    (Clean)
  169. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  170.  
  171. [Untrusted-Action]                                                [Untrusted-Action]
  172. uAction                                        = 4    (Delete)
  173. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  174.  
  175. [Default-Action]                                                [Default-Action]
  176. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  177. uSecAction                                                    =>  = 7 (Deny)
  178.  
  179. [Default-Action]                                                [Default-Action]
  180. uAction                                        = 5    (Clean)
  181. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  182.  
  183. [Default-Action]                                                [Default-Action]
  184. uAction                                        = 4    (Delete)
  185. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  186.  
  187. [General]                                                        [QuarantinePolicy]
  188. szMoveToFolder=\quarantine                                    =>    szQuarantineDirectory=<SYSTEM_DRIVE>\quarantine
  189.  ~OR~
  190. szMoveToFolder=C:\quarantine                                =>    szQuarantineDirectory=C:\quarantine
  191.  
  192. [Alerting]                                                        
  193. -bMoveFiles
  194.  
  195. [Reporting]
  196. -bLogUserName
  197.  
  198. [UIPOptions]
  199. UseUTF8=0
  200. ----------------------------------------------------------------------------- */
  201.  
  202. /* ----------------------------------------------------------------------------
  203. [Server_Trusted-Advanced]                            [Server_Trusted-Spyware]
  204. DetectPrograms                    = 1                =>    DetectPotentiallyUnwantedApps=1
  205. ---------------------------------------------------------------------------- */
  206. insert PolicySettings
  207. (ParentID, SectionName, SettingName, Value)
  208. select #VirusScanPolicyIDs.AutoID3, 'Server_Trusted-Spyware', 'DetectPotentiallyUnwantedApps', Value
  209. from PolicySettings, #VirusScanPolicyIDs
  210. where
  211. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  212. and SectionName = 'Server_Trusted-Advanced'
  213. and SettingName = 'DetectPrograms'
  214.  
  215. delete PolicySettings 
  216. where 
  217. PolicySettings.SectionName = 'Server_Trusted-Advanced'
  218. and PolicySettings.SettingName = 'DetectPrograms'
  219. and PolicySettings.ParentID in 
  220. (select 
  221. AutoID 
  222. from Policy, PolicySettings
  223. where 
  224. Policy.autoid = PolicySettings.parentid
  225. and Policy.ProductCode = 'VIRUSCAN8700'
  226. and Policy.ParentType in (6, 5, 4, 3, 1)
  227. )
  228.  
  229. /* ----------------------------------------------------------------------------
  230. [Wrkstn_Trusted-Advanced]                            [Wrkstn_Trusted-Spyware]
  231. DetectPrograms                    = 1                =>    DetectPotentiallyUnwantedApps=1
  232. ---------------------------------------------------------------------------- */
  233. insert PolicySettings
  234. (ParentID, SectionName, SettingName, Value)
  235. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_Trusted-Spyware', 'DetectPotentiallyUnwantedApps', Value
  236. from PolicySettings, #VirusScanPolicyIDs
  237. where
  238. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  239. and SectionName = 'Wrkstn_Trusted-Advanced'
  240. and SettingName = 'DetectPrograms'
  241.  
  242. delete PolicySettings 
  243. where 
  244. PolicySettings.SectionName = 'Wrkstn_Trusted-Advanced'
  245. and PolicySettings.SettingName = 'DetectPrograms'
  246. and PolicySettings.ParentID in 
  247. (select 
  248. AutoID 
  249. from Policy, PolicySettings
  250. where 
  251. Policy.autoid = PolicySettings.parentid
  252. and Policy.ProductCode = 'VIRUSCAN8700'
  253. and Policy.ParentType in (6, 5, 4, 3, 1)
  254. )
  255.  
  256. /* ----------------------------------------------------------------------------
  257. [Server_Trusted-Advanced]                            [Server_Trusted-Spyware]
  258. DetectJokes                        = 1                =>    DetectJokes=1
  259. ---------------------------------------------------------------------------- */
  260. insert PolicySettings
  261. (ParentID, SectionName, SettingName, Value)
  262. select #VirusScanPolicyIDs.AutoID3, 'Server_Trusted-Spyware', 'DetectJokes', Value
  263. from PolicySettings, #VirusScanPolicyIDs
  264. where
  265. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  266. and SectionName = 'Server_Trusted-Advanced'
  267. and SettingName = 'DetectJokes'
  268.  
  269. delete PolicySettings 
  270. where 
  271. PolicySettings.SectionName = 'Server_Trusted-Advanced'
  272. and PolicySettings.SettingName = 'DetectJokes'
  273. and PolicySettings.ParentID in 
  274. (select 
  275. AutoID 
  276. from Policy, PolicySettings
  277. where 
  278. Policy.autoid = PolicySettings.parentid
  279. and Policy.ProductCode = 'VIRUSCAN8700'
  280. and Policy.ParentType in (6, 5, 4, 3, 1)
  281. )
  282.  
  283. /* ----------------------------------------------------------------------------
  284. [Wrkstn_Trusted-Advanced]                            [Wrkstn_Trusted-Spyware]
  285. DetectJokes                        = 1                =>    DetectJokes=1
  286. ---------------------------------------------------------------------------- */
  287. insert PolicySettings
  288. (ParentID, SectionName, SettingName, Value)
  289. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_Trusted-Spyware', 'DetectJokes', Value
  290. from PolicySettings, #VirusScanPolicyIDs
  291. where
  292. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  293. and SectionName = 'Wrkstn_Trusted-Advanced'
  294. and SettingName = 'DetectJokes'
  295.  
  296. delete PolicySettings 
  297. where 
  298. PolicySettings.SectionName = 'Wrkstn_Trusted-Advanced'
  299. and PolicySettings.SettingName = 'DetectJokes'
  300. and PolicySettings.ParentID in 
  301. (select 
  302. AutoID 
  303. from Policy, PolicySettings
  304. where 
  305. Policy.autoid = PolicySettings.parentid
  306. and Policy.ProductCode = 'VIRUSCAN8700'
  307. and Policy.ParentType in (6, 5, 4, 3, 1)
  308. )
  309.  
  310. /* ----------------------------------------------------------------------------
  311. [Server_Untrusted-Advanced]                            [Server_Untrusted-Spyware]
  312. DetectPrograms                    = 1                =>    DetectPotentiallyUnwantedApps=1
  313. ---------------------------------------------------------------------------- */
  314. insert PolicySettings
  315. (ParentID, SectionName, SettingName, Value)
  316. select #VirusScanPolicyIDs.AutoID3, 'Server_Untrusted-Spyware', 'DetectPotentiallyUnwantedApps', Value
  317. from PolicySettings, #VirusScanPolicyIDs
  318. where
  319. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  320. and SectionName = 'Server_Untrusted-Advanced'
  321. and SettingName = 'DetectPrograms'
  322.  
  323. delete PolicySettings 
  324. where 
  325. PolicySettings.SectionName = 'Server_Untrusted-Advanced'
  326. and PolicySettings.SettingName = 'DetectPrograms'
  327. and PolicySettings.ParentID in 
  328. (select 
  329. AutoID 
  330. from Policy, PolicySettings
  331. where 
  332. Policy.autoid = PolicySettings.parentid
  333. and Policy.ProductCode = 'VIRUSCAN8700'
  334. and Policy.ParentType in (6, 5, 4, 3, 1)
  335. )
  336.  
  337. /* ----------------------------------------------------------------------------
  338. [Wrkstn_Untrusted-Advanced]                            [Wrkstn_Untrusted-Spyware]
  339. DetectPrograms                    = 1                =>    DetectPotentiallyUnwantedApps=1
  340. ---------------------------------------------------------------------------- */
  341. insert PolicySettings
  342. (ParentID, SectionName, SettingName, Value)
  343. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_Untrusted-Spyware', 'DetectPotentiallyUnwantedApps', Value
  344. from PolicySettings, #VirusScanPolicyIDs
  345. where
  346. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  347. and SectionName = 'Wrkstn_Untrusted-Advanced'
  348. and SettingName = 'DetectPrograms'
  349.  
  350. delete PolicySettings 
  351. where 
  352. PolicySettings.SectionName = 'Wrkstn_Untrusted-Advanced'
  353. and PolicySettings.SettingName = 'DetectPrograms'
  354. and PolicySettings.ParentID in 
  355. (select 
  356. AutoID 
  357. from Policy, PolicySettings
  358. where 
  359. Policy.autoid = PolicySettings.parentid
  360. and Policy.ProductCode = 'VIRUSCAN8700'
  361. and Policy.ParentType in (6, 5, 4, 3, 1)
  362. )
  363.  
  364. /* ----------------------------------------------------------------------------
  365. [Server_Untrusted-Advanced]                            [Server_Untrusted-Spyware]
  366. DetectJokes                        = 1                =>    DetectJokes=1
  367. ---------------------------------------------------------------------------- */
  368. insert PolicySettings
  369. (ParentID, SectionName, SettingName, Value)
  370. select #VirusScanPolicyIDs.AutoID3, 'Server_Untrusted-Spyware', 'DetectJokes', Value
  371. from PolicySettings, #VirusScanPolicyIDs
  372. where
  373. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  374. and SectionName = 'Server_Untrusted-Advanced'
  375. and SettingName = 'DetectJokes'
  376.  
  377. delete PolicySettings 
  378. where 
  379. PolicySettings.SectionName = 'Server_Untrusted-Advanced'
  380. and PolicySettings.SettingName = 'DetectJokes'
  381. and PolicySettings.ParentID in 
  382. (select 
  383. AutoID 
  384. from Policy, PolicySettings
  385. where 
  386. Policy.autoid = PolicySettings.parentid
  387. and Policy.ProductCode = 'VIRUSCAN8700'
  388. and Policy.ParentType in (6, 5, 4, 3, 1)
  389. )
  390.  
  391. /* ----------------------------------------------------------------------------
  392. [Wrkstn_Untrusted-Advanced]                            [Wrkstn_Untrusted-Spyware]
  393. DetectJokes                        = 1                =>    DetectJokes=1
  394. ---------------------------------------------------------------------------- */
  395. insert PolicySettings
  396. (ParentID, SectionName, SettingName, Value)
  397. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_Untrusted-Spyware', 'DetectJokes', Value
  398. from PolicySettings, #VirusScanPolicyIDs
  399. where
  400. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  401. and SectionName = 'Wrkstn_Untrusted-Advanced'
  402. and SettingName = 'DetectJokes'
  403.  
  404. delete PolicySettings 
  405. where 
  406. PolicySettings.SectionName = 'Wrkstn_Untrusted-Advanced'
  407. and PolicySettings.SettingName = 'DetectJokes'
  408. and PolicySettings.ParentID in 
  409. (select 
  410. AutoID 
  411. from Policy, PolicySettings
  412. where 
  413. Policy.autoid = PolicySettings.parentid
  414. and Policy.ProductCode = 'VIRUSCAN8700'
  415. and Policy.ParentType in (6, 5, 4, 3, 1)
  416. )
  417.  
  418. /* ----------------------------------------------------------------------------
  419. [Server_Default-Advanced]                            [Server_Default-Spyware]
  420. DetectPrograms                    = 1                =>    DetectPotentiallyUnwantedApps=1
  421. ---------------------------------------------------------------------------- */
  422. insert PolicySettings
  423. (ParentID, SectionName, SettingName, Value)
  424. select #VirusScanPolicyIDs.AutoID3, 'Server_Default-Spyware', 'DetectPotentiallyUnwantedApps', Value
  425. from PolicySettings, #VirusScanPolicyIDs
  426. where
  427. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  428. and SectionName = 'Server_Default-Advanced'
  429. and SettingName = 'DetectPrograms'
  430.  
  431. delete PolicySettings 
  432. where 
  433. PolicySettings.SectionName = 'Server_Default-Advanced'
  434. and PolicySettings.SettingName = 'DetectPrograms'
  435. and PolicySettings.ParentID in 
  436. (select 
  437. AutoID 
  438. from Policy, PolicySettings
  439. where 
  440. Policy.autoid = PolicySettings.parentid
  441. and Policy.ProductCode = 'VIRUSCAN8700'
  442. and Policy.ParentType in (6, 5, 4, 3, 1)
  443. )
  444.  
  445. /* ----------------------------------------------------------------------------
  446. [Wrkstn_Default-Advanced]                            [Wrkstn_Default-Spyware]
  447. DetectPrograms                    = 1                =>    DetectPotentiallyUnwantedApps=1
  448. ---------------------------------------------------------------------------- */
  449. insert PolicySettings
  450. (ParentID, SectionName, SettingName, Value)
  451. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_Default-Spyware', 'DetectPotentiallyUnwantedApps', Value
  452. from PolicySettings, #VirusScanPolicyIDs
  453. where
  454. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  455. and SectionName = 'Wrkstn_Default-Advanced'
  456. and SettingName = 'DetectPrograms'
  457.  
  458. delete PolicySettings 
  459. where 
  460. PolicySettings.SectionName = 'Wrkstn_Default-Advanced'
  461. and PolicySettings.SettingName = 'DetectPrograms'
  462. and PolicySettings.ParentID in 
  463. (select 
  464. AutoID 
  465. from Policy, PolicySettings
  466. where 
  467. Policy.autoid = PolicySettings.parentid
  468. and Policy.ProductCode = 'VIRUSCAN8700'
  469. and Policy.ParentType in (6, 5, 4, 3, 1)
  470. )
  471.  
  472. /* ----------------------------------------------------------------------------
  473. [Server_Default-Advanced]                            [Server_Default-Spyware]
  474. DetectJokes                        = 1                =>    DetectJokes=1
  475. ---------------------------------------------------------------------------- */
  476. insert PolicySettings
  477. (ParentID, SectionName, SettingName, Value)
  478. select #VirusScanPolicyIDs.AutoID3, 'Server_Default-Spyware', 'DetectJokes', Value
  479. from PolicySettings, #VirusScanPolicyIDs
  480. where
  481. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  482. and SectionName = 'Server_Default-Advanced'
  483. and SettingName = 'DetectJokes'
  484.  
  485. delete PolicySettings 
  486. where 
  487. PolicySettings.SectionName = 'Server_Default-Advanced'
  488. and PolicySettings.SettingName = 'DetectJokes'
  489. and PolicySettings.ParentID in 
  490. (select 
  491. AutoID 
  492. from Policy, PolicySettings
  493. where 
  494. Policy.autoid = PolicySettings.parentid
  495. and Policy.ProductCode = 'VIRUSCAN8700'
  496. and Policy.ParentType in (6, 5, 4, 3, 1)
  497. )
  498.  
  499. /* ----------------------------------------------------------------------------
  500. [Wrkstn_Default-Advanced]                            [Wrkstn_Default-Spyware]
  501. DetectJokes                        = 1                =>    DetectJokes=1
  502. ---------------------------------------------------------------------------- */
  503. insert PolicySettings
  504. (ParentID, SectionName, SettingName, Value)
  505. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_Default-Spyware', 'DetectJokes', Value
  506. from PolicySettings, #VirusScanPolicyIDs
  507. where
  508. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  509. and SectionName = 'Wrkstn_Default-Advanced'
  510. and SettingName = 'DetectJokes'
  511.  
  512. delete PolicySettings 
  513. where 
  514. PolicySettings.SectionName = 'Wrkstn_Default-Advanced'
  515. and PolicySettings.SettingName = 'DetectJokes'
  516. and PolicySettings.ParentID in 
  517. (select 
  518. AutoID 
  519. from Policy, PolicySettings
  520. where 
  521. Policy.autoid = PolicySettings.parentid
  522. and Policy.ProductCode = 'VIRUSCAN8700'
  523. and Policy.ParentType in (6, 5, 4, 3, 1)
  524. )
  525.  
  526. /* ----------------------------------------------------------------------------
  527. [Server_Trusted-Action]                                    [Server_Trusted-Action]
  528. uAction                                = 1                =>  = 7 (Deny)
  529. uAction                                = 6                =>  = 1 (Continue)
  530. uSecAction                            = 1                =>  = 7 (Deny)
  531. uSecAction                            = 6                =>  = 1 (Continue)
  532. ---------------------------------------------------------------------------- */
  533. update PolicySettings
  534. set Value = '7'
  535. where
  536. SectionName = 'Server_Trusted-Action'
  537. and SettingName = 'uAction'
  538. and PolicySettings.parentid in 
  539.     (select b.parentid
  540.     from #VirusScanPolicyIDs, PolicySettings b
  541.     where
  542.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  543.     and b.SectionName = 'Server_Trusted-Action'
  544.     and b.SettingName = 'uAction'
  545.     and b.Value = '1'
  546.     )
  547.  
  548. update PolicySettings
  549. set Value = '1'
  550. where
  551. SectionName = 'Server_Trusted-Action'
  552. and SettingName = 'uAction'
  553. and PolicySettings.parentid in 
  554.     (select b.parentid
  555.     from #VirusScanPolicyIDs, PolicySettings b
  556.     where
  557.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  558.     and b.SectionName = 'Server_Trusted-Action'
  559.     and b.SettingName = 'uAction'
  560.     and b.Value = '6'
  561.     )
  562.  
  563. update PolicySettings
  564. set Value = '7'
  565. where
  566. SectionName = 'Server_Trusted-Action'
  567. and SettingName = 'uSecAction'
  568. and PolicySettings.parentid in 
  569.     (select b.parentid
  570.     from #VirusScanPolicyIDs, PolicySettings b
  571.     where
  572.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  573.     and b.SectionName = 'Server_Trusted-Action'
  574.     and b.SettingName = 'uSecAction'
  575.     and b.Value = '1'
  576.     )
  577.  
  578. update PolicySettings
  579. set Value = '1'
  580. where
  581. SectionName = 'Server_Trusted-Action'
  582. and SettingName = 'uSecAction'
  583. and PolicySettings.parentid in 
  584.     (select b.parentid
  585.     from #VirusScanPolicyIDs, PolicySettings b
  586.     where
  587.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  588.     and b.SectionName = 'Server_Trusted-Action'
  589.     and b.SettingName = 'uSecAction'
  590.     and b.Value = '6'
  591.     )
  592.     
  593. /* ----------------------------------------------------------------------------
  594. [Wrkstn_Trusted-Action]                                    [Wrkstn_Trusted-Action]
  595. uAction                                = 1                =>  = 7 (Deny)
  596. uAction                                = 6                =>  = 1 (Continue)
  597. uSecAction                            = 1                =>  = 7 (Deny)
  598. uSecAction                            = 6                =>  = 1 (Continue)
  599. ---------------------------------------------------------------------------- */
  600. update PolicySettings
  601. set Value = '7'
  602. where
  603. SectionName = 'Wrkstn_Trusted-Action'
  604. and SettingName = 'uAction'
  605. and PolicySettings.parentid in 
  606.     (select b.parentid
  607.     from #VirusScanPolicyIDs, PolicySettings b
  608.     where
  609.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  610.     and b.SectionName = 'Wrkstn_Trusted-Action'
  611.     and b.SettingName = 'uAction'
  612.     and b.Value = '1'
  613.     )
  614.  
  615. update PolicySettings
  616. set Value = '1'
  617. where
  618. SectionName = 'Wrkstn_Trusted-Action'
  619. and SettingName = 'uAction'
  620. and PolicySettings.parentid in 
  621.     (select b.parentid
  622.     from #VirusScanPolicyIDs, PolicySettings b
  623.     where
  624.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  625.     and b.SectionName = 'Wrkstn_Trusted-Action'
  626.     and b.SettingName = 'uAction'
  627.     and b.Value = '6'
  628.     )
  629.  
  630. update PolicySettings
  631. set Value = '7'
  632. where
  633. SectionName = 'Wrkstn_Trusted-Action'
  634. and SettingName = 'uSecAction'
  635. and PolicySettings.parentid in 
  636.     (select b.parentid
  637.     from #VirusScanPolicyIDs, PolicySettings b
  638.     where
  639.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  640.     and b.SectionName = 'Wrkstn_Trusted-Action'
  641.     and b.SettingName = 'uSecAction'
  642.     and b.Value = '1'
  643.     )
  644.  
  645. update PolicySettings
  646. set Value = '1'
  647. where
  648. SectionName = 'Wrkstn_Trusted-Action'
  649. and SettingName = 'uSecAction'
  650. and PolicySettings.parentid in 
  651.     (select b.parentid
  652.     from #VirusScanPolicyIDs, PolicySettings b
  653.     where
  654.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  655.     and b.SectionName = 'Wrkstn_Trusted-Action'
  656.     and b.SettingName = 'uSecAction'
  657.     and b.Value = '6'
  658.     )
  659.  
  660. /* ----------------------------------------------------------------------------
  661. [Server_Untrusted-Action]                                [Server_Untrusted-Action]
  662. uAction                                = 1                =>  = 7 (Deny)
  663. uAction                                = 6                =>  = 1 (Continue)
  664. uSecAction                            = 1                =>  = 7 (Deny)
  665. uSecAction                            = 6                =>  = 1 (Continue)
  666. ---------------------------------------------------------------------------- */
  667. update PolicySettings
  668. set Value = '7'
  669. where
  670. SectionName = 'Server_Untrusted-Action'
  671. and SettingName = 'uAction'
  672. and PolicySettings.parentid in 
  673.     (select b.parentid
  674.     from #VirusScanPolicyIDs, PolicySettings b
  675.     where
  676.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  677.     and b.SectionName = 'Server_Untrusted-Action'
  678.     and b.SettingName = 'uAction'
  679.     and b.Value = '1'
  680.     )
  681.  
  682. update PolicySettings
  683. set Value = '1'
  684. where
  685. SectionName = 'Server_Untrusted-Action'
  686. and SettingName = 'uAction'
  687. and PolicySettings.parentid in 
  688.     (select b.parentid
  689.     from #VirusScanPolicyIDs, PolicySettings b
  690.     where
  691.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  692.     and b.SectionName = 'Server_Untrusted-Action'
  693.     and b.SettingName = 'uAction'
  694.     and b.Value = '6'
  695.     )
  696.  
  697. update PolicySettings
  698. set Value = '7'
  699. where
  700. SectionName = 'Server_Untrusted-Action'
  701. and SettingName = 'uSecAction'
  702. and PolicySettings.parentid in 
  703.     (select b.parentid
  704.     from #VirusScanPolicyIDs, PolicySettings b
  705.     where
  706.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  707.     and b.SectionName = 'Server_Untrusted-Action'
  708.     and b.SettingName = 'uSecAction'
  709.     and b.Value = '1'
  710.     )
  711.  
  712. update PolicySettings
  713. set Value = '1'
  714. where
  715. SectionName = 'Server_Untrusted-Action'
  716. and SettingName = 'uSecAction'
  717. and PolicySettings.parentid in 
  718.     (select b.parentid
  719.     from #VirusScanPolicyIDs, PolicySettings b
  720.     where
  721.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  722.     and b.SectionName = 'Server_Untrusted-Action'
  723.     and b.SettingName = 'uSecAction'
  724.     and b.Value = '6'
  725.     )
  726.  
  727. /* ----------------------------------------------------------------------------
  728. [Wrkstn_Untrusted-Action]                                [Wrkstn_Untrusted-Action]
  729. uAction                                = 1                =>  = 7 (Deny)
  730. uAction                                = 6                =>  = 1 (Continue)
  731. uSecAction                            = 1                =>  = 7 (Deny)
  732. uSecAction                            = 6                =>  = 1 (Continue)
  733. ---------------------------------------------------------------------------- */
  734. update PolicySettings
  735. set Value = '7'
  736. where
  737. SectionName = 'Wrkstn_Untrusted-Action'
  738. and SettingName = 'uAction'
  739. and PolicySettings.parentid in 
  740.     (select b.parentid
  741.     from #VirusScanPolicyIDs, PolicySettings b
  742.     where
  743.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  744.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  745.     and b.SettingName = 'uAction'
  746.     and b.Value = '1'
  747.     )
  748.  
  749. update PolicySettings
  750. set Value = '1'
  751. where
  752. SectionName = 'Wrkstn_Untrusted-Action'
  753. and SettingName = 'uAction'
  754. and PolicySettings.parentid in 
  755.     (select b.parentid
  756.     from #VirusScanPolicyIDs, PolicySettings b
  757.     where
  758.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  759.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  760.     and b.SettingName = 'uAction'
  761.     and b.Value = '6'
  762.     )
  763.  
  764. update PolicySettings
  765. set Value = '7'
  766. where
  767. SectionName = 'Wrkstn_Untrusted-Action'
  768. and SettingName = 'uSecAction'
  769. and PolicySettings.parentid in 
  770.     (select b.parentid
  771.     from #VirusScanPolicyIDs, PolicySettings b
  772.     where
  773.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  774.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  775.     and b.SettingName = 'uSecAction'
  776.     and b.Value = '1'
  777.     )
  778.  
  779. update PolicySettings
  780. set Value = '1'
  781. where
  782. SectionName = 'Wrkstn_Untrusted-Action'
  783. and SettingName = 'uSecAction'
  784. and PolicySettings.parentid in 
  785.     (select b.parentid
  786.     from #VirusScanPolicyIDs, PolicySettings b
  787.     where
  788.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  789.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  790.     and b.SettingName = 'uSecAction'
  791.     and b.Value = '6'
  792.     )
  793.  
  794. /* ----------------------------------------------------------------------------
  795. [Server_Default-Action]                                    [Server_Default-Action]
  796. uAction                                = 1                =>  = 7 (Deny)
  797. uAction                                = 6                =>  = 1 (Continue)
  798. uSecAction                            = 1                =>  = 7 (Deny)
  799. uSecAction                            = 6                =>  = 1 (Continue)
  800. ---------------------------------------------------------------------------- */
  801. update PolicySettings
  802. set Value = '7'
  803. where
  804. SectionName = 'Server_Default-Action'
  805. and SettingName = 'uAction'
  806. and PolicySettings.parentid in 
  807.     (select b.parentid
  808.     from #VirusScanPolicyIDs, PolicySettings b
  809.     where
  810.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  811.     and b.SectionName = 'Server_Default-Action'
  812.     and b.SettingName = 'uAction'
  813.     and b.Value = '1'
  814.     )
  815.  
  816. update PolicySettings
  817. set Value = '1'
  818. where
  819. SectionName = 'Server_Default-Action'
  820. and SettingName = 'uAction'
  821. and PolicySettings.parentid in 
  822.     (select b.parentid
  823.     from #VirusScanPolicyIDs, PolicySettings b
  824.     where
  825.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  826.     and b.SectionName = 'Server_Default-Action'
  827.     and b.SettingName = 'uAction'
  828.     and b.Value = '6'
  829.     )
  830.  
  831. update PolicySettings
  832. set Value = '7'
  833. where
  834. SectionName = 'Server_Default-Action'
  835. and SettingName = 'uSecAction'
  836. and PolicySettings.parentid in 
  837.     (select b.parentid
  838.     from #VirusScanPolicyIDs, PolicySettings b
  839.     where
  840.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  841.     and b.SectionName = 'Server_Default-Action'
  842.     and b.SettingName = 'uSecAction'
  843.     and b.Value = '1'
  844.     )
  845.  
  846. update PolicySettings
  847. set Value = '1'
  848. where
  849. SectionName = 'Server_Default-Action'
  850. and SettingName = 'uSecAction'
  851. and PolicySettings.parentid in 
  852.     (select b.parentid
  853.     from #VirusScanPolicyIDs, PolicySettings b
  854.     where
  855.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  856.     and b.SectionName = 'Server_Default-Action'
  857.     and b.SettingName = 'uSecAction'
  858.     and b.Value = '6'
  859.     )
  860.     
  861. /* ----------------------------------------------------------------------------
  862. [Wrkstn_Default-Action]                                    [Wrkstn_Default-Action]
  863. uAction                                = 1                =>  = 7 (Deny)
  864. uAction                                = 6                =>  = 1 (Continue)
  865. uSecAction                            = 1                =>  = 7 (Deny)
  866. uSecAction                            = 6                =>  = 1 (Continue)
  867. ---------------------------------------------------------------------------- */
  868. update PolicySettings
  869. set Value = '7'
  870. where
  871. SectionName = 'Wrkstn_Default-Action'
  872. and SettingName = 'uAction'
  873. and PolicySettings.parentid in 
  874.     (select b.parentid
  875.     from #VirusScanPolicyIDs, PolicySettings b
  876.     where
  877.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  878.     and b.SectionName = 'Wrkstn_Default-Action'
  879.     and b.SettingName = 'uAction'
  880.     and b.Value = '1'
  881.     )
  882.  
  883. update PolicySettings
  884. set Value = '1'
  885. where
  886. SectionName = 'Wrkstn_Default-Action'
  887. and SettingName = 'uAction'
  888. and PolicySettings.parentid in 
  889.     (select b.parentid
  890.     from #VirusScanPolicyIDs, PolicySettings b
  891.     where
  892.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  893.     and b.SectionName = 'Wrkstn_Default-Action'
  894.     and b.SettingName = 'uAction'
  895.     and b.Value = '6'
  896.     )
  897.  
  898. update PolicySettings
  899. set Value = '7'
  900. where
  901. SectionName = 'Wrkstn_Default-Action'
  902. and SettingName = 'uSecAction'
  903. and PolicySettings.parentid in 
  904.     (select b.parentid
  905.     from #VirusScanPolicyIDs, PolicySettings b
  906.     where
  907.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  908.     and b.SectionName = 'Wrkstn_Default-Action'
  909.     and b.SettingName = 'uSecAction'
  910.     and b.Value = '1'
  911.     )
  912.  
  913. update PolicySettings
  914. set Value = '1'
  915. where
  916. SectionName = 'Wrkstn_Default-Action'
  917. and SettingName = 'uSecAction'
  918. and PolicySettings.parentid in 
  919.     (select b.parentid
  920.     from #VirusScanPolicyIDs, PolicySettings b
  921.     where
  922.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  923.     and b.SectionName = 'Wrkstn_Default-Action'
  924.     and b.SettingName = 'uSecAction'
  925.     and b.Value = '6'
  926.     )
  927.  
  928. /* ----------------------------------------------------------------------------
  929. [Server_EmailDetection]                                            [Server_EmailDetection]
  930. ExtensionFilterOption (AllFiles)             = 0x00000001     =>     ExtensionMode=1
  931.                       (Default)             = 0x00000002     =>    ExtensionMode=3
  932.                       (Specified)            = 0x00000004     =>    ExtensionMode=4
  933. dwDetect              (Default + Macros)    = 0x00001000     =>    ExtensionMode=2
  934. ---------------------------------------------------------------------------- */
  935. insert PolicySettings
  936. (ParentID, SectionName, SettingName, Value)
  937. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailDetection', 'ExtensionMode', '1'
  938. from PolicySettings b, #VirusScanPolicyIDs
  939. where
  940. b.ParentID = #VirusScanPolicyIDs.AutoID2
  941. and b.SectionName = 'Server_EmailDetection'
  942. and b.SettingName = 'ExtensionFilterOption'
  943.  
  944. update PolicySettings
  945. set Value = '1'
  946. where
  947. SectionName = 'Server_EmailDetection'
  948. and SettingName = 'ExtensionMode'
  949. and PolicySettings.parentid in 
  950.     (select b.parentid
  951.     from #VirusScanPolicyIDs, PolicySettings b
  952.     where
  953.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  954.     and b.SectionName = 'Server_EmailDetection'
  955.     and b.SettingName = 'ExtensionFilterOption'
  956.     and (convert(int,value) & 0x00000001) > 0
  957.     )
  958.  
  959. update PolicySettings
  960. set Value = '3'
  961. where
  962. SectionName = 'Server_EmailDetection'
  963. and SettingName = 'ExtensionMode'
  964. and PolicySettings.parentid in 
  965.     (select b.parentid
  966.     from #VirusScanPolicyIDs, PolicySettings b
  967.     where
  968.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  969.     and b.SectionName = 'Server_EmailDetection'
  970.     and b.SettingName = 'ExtensionFilterOption'
  971.     and (convert(int,value) & 0x00000002) > 0
  972.     )
  973.       
  974. update PolicySettings
  975. set Value = '4'
  976. where
  977. SectionName = 'Server_EmailDetection'
  978. and SettingName = 'ExtensionMode'
  979. and PolicySettings.parentid in 
  980.     (select b.parentid
  981.     from #VirusScanPolicyIDs, PolicySettings b
  982.     where
  983.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  984.     and b.SectionName = 'Server_EmailDetection'
  985.     and b.SettingName = 'ExtensionFilterOption'
  986.     and (convert(int,value) & 0x00000004) > 0
  987.     )
  988.  
  989. update PolicySettings
  990. set Value = '2'
  991. where
  992. SectionName = 'Server_EmailDetection'
  993. and SettingName = 'ExtensionMode'
  994. and PolicySettings.parentid in 
  995.     (select b.parentid
  996.     from #VirusScanPolicyIDs, PolicySettings b
  997.     where
  998.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  999.     and b.SectionName = 'Server_EmailDetection'
  1000.     and b.SettingName = 'dwDetect'
  1001.     and (convert(int,value) & 0x00001000) > 0
  1002.     -- Ignore this flag unless ExtensionFilterOption is set to use default files.  
  1003.     -- The 7.1 NAP was not good about clearing it if it wasn't being used.
  1004.     and PolicySettings.parentid in 
  1005.         (select a.parentid
  1006.         from #VirusScanPolicyIDs, PolicySettings a
  1007.         where
  1008.         a.ParentID = #VirusScanPolicyIDs.AutoID3
  1009.         and a.SectionName = 'Server_EmailDetection'
  1010.         and a.SettingName = 'ExtensionFilterOption'
  1011.         and (convert(int,value) & 0x00000002) > 0
  1012.         )
  1013.     )
  1014.  
  1015. delete PolicySettings 
  1016. where 
  1017. PolicySettings.SectionName = 'Server_EmailDetection'
  1018. and PolicySettings.SettingName = 'ExtensionFilterOption'
  1019. and PolicySettings.ParentID in 
  1020. (select 
  1021. AutoID 
  1022. from Policy, PolicySettings
  1023. where 
  1024. Policy.autoid = PolicySettings.parentid
  1025. and Policy.ProductCode = 'VIRUSCAN8700'
  1026. and Policy.ParentType in (6, 5, 4, 3, 1)
  1027. )
  1028.  
  1029. delete PolicySettings 
  1030. where 
  1031. PolicySettings.SectionName = 'Server_EmailDetection'
  1032. and PolicySettings.SettingName = 'dwDetect'
  1033. and PolicySettings.ParentID in 
  1034. (select 
  1035. AutoID 
  1036. from Policy, PolicySettings
  1037. where 
  1038. Policy.autoid = PolicySettings.parentid
  1039. and Policy.ProductCode = 'VIRUSCAN8700'
  1040. and Policy.ParentType in (6, 5, 4, 3, 1)
  1041. )
  1042.                       
  1043. /* ----------------------------------------------------------------------------
  1044. [Wrkstn_EmailDetection]                                            [Wrkstn_EmailDetection]
  1045. ExtensionFilterOption (AllFiles)             = 0x00000001     =>     ExtensionMode=1
  1046.                       (Default)             = 0x00000002     =>    ExtensionMode=3
  1047.                       (Specified)            = 0x00000004     =>    ExtensionMode=4
  1048. dwDetect              (Default + Macros)    = 0x00001000     =>    ExtensionMode=2
  1049. ---------------------------------------------------------------------------- */
  1050. insert PolicySettings
  1051. (ParentID, SectionName, SettingName, Value)
  1052. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailDetection', 'ExtensionMode', '1'
  1053. from PolicySettings b, #VirusScanPolicyIDs
  1054. where
  1055. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1056. and b.SectionName = 'Wrkstn_EmailDetection'
  1057. and b.SettingName = 'ExtensionFilterOption'
  1058.  
  1059. update PolicySettings
  1060. set Value = '1'
  1061. where
  1062. SectionName = 'Wrkstn_EmailDetection'
  1063. and SettingName = 'ExtensionMode'
  1064. and PolicySettings.parentid in 
  1065.     (select b.parentid
  1066.     from #VirusScanPolicyIDs, PolicySettings b
  1067.     where
  1068.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1069.     and b.SectionName = 'Wrkstn_EmailDetection'
  1070.     and b.SettingName = 'ExtensionFilterOption'
  1071.     and (convert(int,value) & 0x00000001) > 0
  1072.     )
  1073.  
  1074. update PolicySettings
  1075. set Value = '3'
  1076. where
  1077. SectionName = 'Wrkstn_EmailDetection'
  1078. and SettingName = 'ExtensionMode'
  1079. and PolicySettings.parentid in 
  1080.     (select b.parentid
  1081.     from #VirusScanPolicyIDs, PolicySettings b
  1082.     where
  1083.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1084.     and b.SectionName = 'Wrkstn_EmailDetection'
  1085.     and b.SettingName = 'ExtensionFilterOption'
  1086.     and (convert(int,value) & 0x00000002) > 0
  1087.     )
  1088.       
  1089. update PolicySettings
  1090. set Value = '4'
  1091. where
  1092. SectionName = 'Wrkstn_EmailDetection'
  1093. and SettingName = 'ExtensionMode'
  1094. and PolicySettings.parentid in 
  1095.     (select b.parentid
  1096.     from #VirusScanPolicyIDs, PolicySettings b
  1097.     where
  1098.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1099.     and b.SectionName = 'Wrkstn_EmailDetection'
  1100.     and b.SettingName = 'ExtensionFilterOption'
  1101.     and (convert(int,value) & 0x00000004) > 0
  1102.     )
  1103.  
  1104. update PolicySettings
  1105. set Value = '2'
  1106. where
  1107. SectionName = 'Wrkstn_EmailDetection'
  1108. and SettingName = 'ExtensionMode'
  1109. and PolicySettings.parentid in 
  1110.     (select b.parentid
  1111.     from #VirusScanPolicyIDs, PolicySettings b
  1112.     where
  1113.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1114.     and b.SectionName = 'Wrkstn_EmailDetection'
  1115.     and b.SettingName = 'dwDetect'
  1116.     and (convert(int,value) & 0x00001000) > 0
  1117.     -- Ignore this flag unless ExtensionFilterOption is set to use default files.  
  1118.     -- The 7.1 NAP was not good about clearing it if it wasn't being used.
  1119.     and PolicySettings.parentid in 
  1120.         (select a.parentid
  1121.         from #VirusScanPolicyIDs, PolicySettings a
  1122.         where
  1123.         a.ParentID = #VirusScanPolicyIDs.AutoID3
  1124.         and a.SectionName = 'Wrkstn_EmailDetection'
  1125.         and a.SettingName = 'ExtensionFilterOption'
  1126.         and (convert(int,value) & 0x00000002) > 0
  1127.         )
  1128.     )
  1129.  
  1130. delete PolicySettings 
  1131. where 
  1132. PolicySettings.SectionName = 'Wrkstn_EmailDetection'
  1133. and PolicySettings.SettingName = 'ExtensionFilterOption'
  1134. and PolicySettings.ParentID in 
  1135. (select 
  1136. AutoID 
  1137. from Policy, PolicySettings
  1138. where 
  1139. Policy.autoid = PolicySettings.parentid
  1140. and Policy.ProductCode = 'VIRUSCAN8700'
  1141. and Policy.ParentType in (6, 5, 4, 3, 1)
  1142. )
  1143.  
  1144. delete PolicySettings 
  1145. where 
  1146. PolicySettings.SectionName = 'Wrkstn_EmailDetection'
  1147. and PolicySettings.SettingName = 'dwDetect'
  1148. and PolicySettings.ParentID in 
  1149. (select 
  1150. AutoID 
  1151. from Policy, PolicySettings
  1152. where 
  1153. Policy.autoid = PolicySettings.parentid
  1154. and Policy.ProductCode = 'VIRUSCAN8700'
  1155. and Policy.ParentType in (6, 5, 4, 3, 1)
  1156. )         
  1157.                       
  1158. /* ----------------------------------------------------------------------------              
  1159. [Server_EmailAdvanced]                                            [Server_EmailAdvanced]
  1160. dwDetectOptions (ProgramHeuristics)            = 0x00000008    =>    dwProgramHeuristicsLevel=1
  1161. dwDetectOptions    (MacroHeuristics)            = 0x00000004    =>    dwMacroHeuristicsLevel=1
  1162. dwDetectOptions    (ScanArchive)                = 0x00000800    =>    ScanArchives=1
  1163. dwDetectOptions    (ScanCompressedEXE)            = 0x00000010    =>    bScanCompressed=1
  1164. dwDetectOptions    (ScanMIME)                    = 0x00010000    =>    ScanMime=1
  1165. ---------------------------------------------------------------------------- */
  1166. insert PolicySettings
  1167. (ParentID, SectionName, SettingName, Value)
  1168. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAdvanced', 'dwProgramHeuristicsLevel', '0'
  1169. from PolicySettings b, #VirusScanPolicyIDs
  1170. where
  1171. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1172. and b.SectionName = 'Server_EmailAdvanced'
  1173. and b.SettingName = 'dwDetectOptions'
  1174.  
  1175. update PolicySettings
  1176. set Value = '1'
  1177. where
  1178. SectionName = 'Server_EmailAdvanced'
  1179. and SettingName = 'dwProgramHeuristicsLevel'
  1180. and PolicySettings.parentid in 
  1181.     (select b.parentid
  1182.     from #VirusScanPolicyIDs, PolicySettings b
  1183.     where
  1184.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1185.     and b.SectionName = 'Server_EmailAdvanced'
  1186.     and b.SettingName = 'dwDetectOptions'
  1187.     and (convert(int,value) & 0x00000008) > 0
  1188.     )
  1189.  
  1190. insert PolicySettings
  1191. (ParentID, SectionName, SettingName, Value)
  1192. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAdvanced', 'dwMacroHeuristicsLevel', '0'
  1193. from PolicySettings b, #VirusScanPolicyIDs
  1194. where
  1195. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1196. and b.SectionName = 'Server_EmailAdvanced'
  1197. and b.SettingName = 'dwDetectOptions'
  1198.  
  1199. update PolicySettings
  1200. set Value = '1'
  1201. where
  1202. SectionName = 'Server_EmailAdvanced'
  1203. and SettingName = 'dwMacroHeuristicsLevel'
  1204. and PolicySettings.parentid in 
  1205.     (select b.parentid
  1206.     from #VirusScanPolicyIDs, PolicySettings b
  1207.     where
  1208.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1209.     and b.SectionName = 'Server_EmailAdvanced'
  1210.     and b.SettingName = 'dwDetectOptions'
  1211.     and (convert(int,value) & 0x00000004) > 0
  1212.     )
  1213.  
  1214. insert PolicySettings
  1215. (ParentID, SectionName, SettingName, Value)
  1216. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAdvanced', 'ScanArchives', '0'
  1217. from PolicySettings b, #VirusScanPolicyIDs
  1218. where
  1219. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1220. and b.SectionName = 'Server_EmailAdvanced'
  1221. and b.SettingName = 'dwDetectOptions'
  1222.  
  1223. update PolicySettings
  1224. set Value = '1'
  1225. where
  1226. SectionName = 'Server_EmailAdvanced'
  1227. and SettingName = 'ScanArchives'
  1228. and PolicySettings.parentid in 
  1229.     (select b.parentid
  1230.     from #VirusScanPolicyIDs, PolicySettings b
  1231.     where
  1232.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1233.     and b.SectionName = 'Server_EmailAdvanced'
  1234.     and b.SettingName = 'dwDetectOptions'
  1235.     and (convert(int,value) & 0x00000800) > 0
  1236.     )
  1237.  
  1238. insert PolicySettings
  1239. (ParentID, SectionName, SettingName, Value)
  1240. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAdvanced', 'bScanCompressed', '0'
  1241. from PolicySettings b, #VirusScanPolicyIDs
  1242. where
  1243. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1244. and b.SectionName = 'Server_EmailAdvanced'
  1245. and b.SettingName = 'dwDetectOptions'
  1246.  
  1247. update PolicySettings
  1248. set Value = '1'
  1249. where
  1250. SectionName = 'Server_EmailAdvanced'
  1251. and SettingName = 'bScanCompressed'
  1252. and PolicySettings.parentid in 
  1253.     (select b.parentid
  1254.     from #VirusScanPolicyIDs, PolicySettings b
  1255.     where
  1256.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1257.     and b.SectionName = 'Server_EmailAdvanced'
  1258.     and b.SettingName = 'dwDetectOptions'
  1259.     and (convert(int,value) & 0x00000010) > 0
  1260.     )
  1261.  
  1262. insert PolicySettings
  1263. (ParentID, SectionName, SettingName, Value)
  1264. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAdvanced', 'ScanMime', '0'
  1265. from PolicySettings b, #VirusScanPolicyIDs
  1266. where
  1267. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1268. and b.SectionName = 'Server_EmailAdvanced'
  1269. and b.SettingName = 'dwDetectOptions'
  1270.  
  1271. update PolicySettings
  1272. set Value = '1'
  1273. where
  1274. SectionName = 'Server_EmailAdvanced'
  1275. and SettingName = 'ScanMime'
  1276. and PolicySettings.parentid in 
  1277.     (select b.parentid
  1278.     from #VirusScanPolicyIDs, PolicySettings b
  1279.     where
  1280.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1281.     and b.SectionName = 'Server_EmailAdvanced'
  1282.     and b.SettingName = 'dwDetectOptions'
  1283.     and (convert(int,value) & 0x00010000) > 0
  1284.     )
  1285.  
  1286. delete PolicySettings 
  1287. where 
  1288. PolicySettings.SectionName = 'Server_EmailDetection'
  1289. and PolicySettings.SettingName = 'dwDetectOptions'
  1290. and PolicySettings.ParentID in 
  1291. (select 
  1292. AutoID 
  1293. from Policy, PolicySettings
  1294. where 
  1295. Policy.autoid = PolicySettings.parentid
  1296. and Policy.ProductCode = 'VIRUSCAN8700'
  1297. and Policy.ParentType in (6, 5, 4, 3, 1)
  1298. )
  1299.  
  1300. /* ----------------------------------------------------------------------------              
  1301. [Wrkstn_EmailAdvanced]                                            [Wrkstn_EmailAdvanced]
  1302. dwDetectOptions (ProgramHeuristics)            = 0x00000008    =>    dwProgramHeuristicsLevel=1
  1303. dwDetectOptions    (MacroHeuristics)            = 0x00000004    =>    dwMacroHeuristicsLevel=1
  1304. dwDetectOptions    (ScanArchive)                = 0x00000800    =>    ScanArchives=1
  1305. dwDetectOptions    (ScanCompressedEXE)            = 0x00000010    =>    bScanCompressed=1
  1306. dwDetectOptions    (ScanMIME)                    = 0x00010000    =>    ScanMime=1
  1307. ---------------------------------------------------------------------------- */
  1308. insert PolicySettings
  1309. (ParentID, SectionName, SettingName, Value)
  1310. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAdvanced', 'dwProgramHeuristicsLevel', '0'
  1311. from PolicySettings b, #VirusScanPolicyIDs
  1312. where
  1313. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1314. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1315. and b.SettingName = 'dwDetectOptions'
  1316.  
  1317. update PolicySettings
  1318. set Value = '1'
  1319. where
  1320. SectionName = 'Wrkstn_EmailAdvanced'
  1321. and SettingName = 'dwProgramHeuristicsLevel'
  1322. and PolicySettings.parentid in 
  1323.     (select b.parentid
  1324.     from #VirusScanPolicyIDs, PolicySettings b
  1325.     where
  1326.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1327.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1328.     and b.SettingName = 'dwDetectOptions'
  1329.     and (convert(int,value) & 0x00000008) > 0
  1330.     )
  1331.  
  1332. insert PolicySettings
  1333. (ParentID, SectionName, SettingName, Value)
  1334. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAdvanced', 'dwMacroHeuristicsLevel', '0'
  1335. from PolicySettings b, #VirusScanPolicyIDs
  1336. where
  1337. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1338. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1339. and b.SettingName = 'dwDetectOptions'
  1340.  
  1341. update PolicySettings
  1342. set Value = '1'
  1343. where
  1344. SectionName = 'Wrkstn_EmailAdvanced'
  1345. and SettingName = 'dwMacroHeuristicsLevel'
  1346. and PolicySettings.parentid in 
  1347.     (select b.parentid
  1348.     from #VirusScanPolicyIDs, PolicySettings b
  1349.     where
  1350.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1351.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1352.     and b.SettingName = 'dwDetectOptions'
  1353.     and (convert(int,value) & 0x00000004) > 0
  1354.     )
  1355.  
  1356. insert PolicySettings
  1357. (ParentID, SectionName, SettingName, Value)
  1358. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAdvanced', 'ScanArchives', '0'
  1359. from PolicySettings b, #VirusScanPolicyIDs
  1360. where
  1361. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1362. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1363. and b.SettingName = 'dwDetectOptions'
  1364.  
  1365. update PolicySettings
  1366. set Value = '1'
  1367. where
  1368. SectionName = 'Wrkstn_EmailAdvanced'
  1369. and SettingName = 'ScanArchives'
  1370. and PolicySettings.parentid in 
  1371.     (select b.parentid
  1372.     from #VirusScanPolicyIDs, PolicySettings b
  1373.     where
  1374.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1375.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1376.     and b.SettingName = 'dwDetectOptions'
  1377.     and (convert(int,value) & 0x00000800) > 0
  1378.     )
  1379.  
  1380. insert PolicySettings
  1381. (ParentID, SectionName, SettingName, Value)
  1382. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAdvanced', 'bScanCompressed', '0'
  1383. from PolicySettings b, #VirusScanPolicyIDs
  1384. where
  1385. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1386. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1387. and b.SettingName = 'dwDetectOptions'
  1388.  
  1389. update PolicySettings
  1390. set Value = '1'
  1391. where
  1392. SectionName = 'Wrkstn_EmailAdvanced'
  1393. and SettingName = 'bScanCompressed'
  1394. and PolicySettings.parentid in 
  1395.     (select b.parentid
  1396.     from #VirusScanPolicyIDs, PolicySettings b
  1397.     where
  1398.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1399.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1400.     and b.SettingName = 'dwDetectOptions'
  1401.     and (convert(int,value) & 0x00000010) > 0
  1402.     )
  1403.  
  1404. insert PolicySettings
  1405. (ParentID, SectionName, SettingName, Value)
  1406. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAdvanced', 'ScanMime', '0'
  1407. from PolicySettings b, #VirusScanPolicyIDs
  1408. where
  1409. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1410. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1411. and b.SettingName = 'dwDetectOptions'
  1412.  
  1413. update PolicySettings
  1414. set Value = '1'
  1415. where
  1416. SectionName = 'Wrkstn_EmailAdvanced'
  1417. and SettingName = 'ScanMime'
  1418. and PolicySettings.parentid in 
  1419.     (select b.parentid
  1420.     from #VirusScanPolicyIDs, PolicySettings b
  1421.     where
  1422.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1423.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1424.     and b.SettingName = 'dwDetectOptions'
  1425.     and (convert(int,value) & 0x00010000) > 0
  1426.     )
  1427.  
  1428. delete PolicySettings 
  1429. where 
  1430. PolicySettings.SectionName = 'Wrkstn_EmailDetection'
  1431. and PolicySettings.SettingName = 'dwDetectOptions'
  1432. and PolicySettings.ParentID in 
  1433. (select 
  1434. AutoID 
  1435. from Policy, PolicySettings
  1436. where 
  1437. Policy.autoid = PolicySettings.parentid
  1438. and Policy.ProductCode = 'VIRUSCAN8700'
  1439. and Policy.ParentType in (6, 5, 4, 3, 1)
  1440. )
  1441.  
  1442. /* ----------------------------------------------------------------------------
  1443. [Server_EmailAdvanced]                                            [Server_EmailAdvanced]
  1444. AdvancedFilterOption (ScanBody)                = 0x00000008    =>    ScanMessageBodies=1
  1445. AdvancedFilterOption (MultiExtensionScan)    = 0x00000010    =>    MultipleExtensionsHeuristic=1
  1446. ---------------------------------------------------------------------------- */
  1447. insert PolicySettings
  1448. (ParentID, SectionName, SettingName, Value)
  1449. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAdvanced', 'ScanMessageBodies', '0'
  1450. from PolicySettings b, #VirusScanPolicyIDs
  1451. where
  1452. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1453. and b.SectionName = 'Server_EmailAdvanced'
  1454. and b.SettingName = 'AdvancedFilterOption'
  1455.  
  1456. update PolicySettings
  1457. set Value = '1'
  1458. where
  1459. SectionName = 'Server_EmailAdvanced'
  1460. and SettingName = 'ScanMessageBodies'
  1461. and PolicySettings.parentid in 
  1462.     (select b.parentid
  1463.     from #VirusScanPolicyIDs, PolicySettings b
  1464.     where
  1465.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1466.     and b.SectionName = 'Server_EmailAdvanced'
  1467.     and b.SettingName = 'AdvancedFilterOption'
  1468.     and (convert(int,value) & 0x00000008) > 0
  1469.     )
  1470.  
  1471. insert PolicySettings
  1472. (ParentID, SectionName, SettingName, Value)
  1473. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAdvanced', 'MultipleExtensionsHeuristic', '0'
  1474. from PolicySettings b, #VirusScanPolicyIDs
  1475. where
  1476. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1477. and b.SectionName = 'Server_EmailAdvanced'
  1478. and b.SettingName = 'AdvancedFilterOption'
  1479.  
  1480. update PolicySettings
  1481. set Value = '1'
  1482. where
  1483. SectionName = 'Server_EmailAdvanced'
  1484. and SettingName = 'MultipleExtensionsHeuristic'
  1485. and PolicySettings.parentid in 
  1486.     (select b.parentid
  1487.     from #VirusScanPolicyIDs, PolicySettings b
  1488.     where
  1489.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1490.     and b.SectionName = 'Server_EmailAdvanced'
  1491.     and b.SettingName = 'AdvancedFilterOption'
  1492.     and (convert(int,value) & 0x00000010) > 0
  1493.     )
  1494.  
  1495. delete PolicySettings 
  1496. where 
  1497. PolicySettings.SectionName = 'Server_EmailAdvanced'
  1498. and PolicySettings.SettingName = 'AdvancedFilterOption'
  1499. and PolicySettings.ParentID in 
  1500. (select 
  1501. AutoID 
  1502. from Policy, PolicySettings
  1503. where 
  1504. Policy.autoid = PolicySettings.parentid
  1505. and Policy.ProductCode = 'VIRUSCAN8700'
  1506. and Policy.ParentType in (6, 5, 4, 3, 1)
  1507. )
  1508.  
  1509. /* ----------------------------------------------------------------------------
  1510. [Wrkstn_EmailAdvanced]                                            [Wrkstn_EmailAdvanced]
  1511. AdvancedFilterOption (ScanBody)                = 0x00000008    =>    ScanMessageBodies=1
  1512. AdvancedFilterOption (MultiExtensionScan)    = 0x00000010    =>    MultipleExtensionsHeuristic=1
  1513. ---------------------------------------------------------------------------- */
  1514. insert PolicySettings
  1515. (ParentID, SectionName, SettingName, Value)
  1516. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAdvanced', 'ScanMessageBodies', '0'
  1517. from PolicySettings b, #VirusScanPolicyIDs
  1518. where
  1519. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1520. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1521. and b.SettingName = 'AdvancedFilterOption'
  1522.  
  1523. update PolicySettings
  1524. set Value = '1'
  1525. where
  1526. SectionName = 'Wrkstn_EmailAdvanced'
  1527. and SettingName = 'ScanMessageBodies'
  1528. and PolicySettings.parentid in 
  1529.     (select b.parentid
  1530.     from #VirusScanPolicyIDs, PolicySettings b
  1531.     where
  1532.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1533.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1534.     and b.SettingName = 'AdvancedFilterOption'
  1535.     and (convert(int,value) & 0x00000008) > 0
  1536.     )
  1537.  
  1538. insert PolicySettings
  1539. (ParentID, SectionName, SettingName, Value)
  1540. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAdvanced', 'MultipleExtensionsHeuristic', '0'
  1541. from PolicySettings b, #VirusScanPolicyIDs
  1542. where
  1543. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1544. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1545. and b.SettingName = 'AdvancedFilterOption'
  1546.  
  1547. update PolicySettings
  1548. set Value = '1'
  1549. where
  1550. SectionName = 'Wrkstn_EmailAdvanced'
  1551. and SettingName = 'MultipleExtensionsHeuristic'
  1552. and PolicySettings.parentid in 
  1553.     (select b.parentid
  1554.     from #VirusScanPolicyIDs, PolicySettings b
  1555.     where
  1556.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1557.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1558.     and b.SettingName = 'AdvancedFilterOption'
  1559.     and (convert(int,value) & 0x00000010) > 0
  1560.     )
  1561.  
  1562. delete PolicySettings 
  1563. where 
  1564. PolicySettings.SectionName = 'Wrkstn_EmailAdvanced'
  1565. and PolicySettings.SettingName = 'AdvancedFilterOption'
  1566. and PolicySettings.ParentID in 
  1567. (select 
  1568. AutoID 
  1569. from Policy, PolicySettings
  1570. where 
  1571. Policy.autoid = PolicySettings.parentid
  1572. and Policy.ProductCode = 'VIRUSCAN8700'
  1573. and Policy.ParentType in (6, 5, 4, 3, 1)
  1574. )
  1575.  
  1576. /* ----------------------------------------------------------------------------
  1577. [Server_EmailAdvanced]                                            [Server_EmailSpyware]
  1578. dwDetectOptions    (DetectPrograms)            = 0x00004000    =>    DetectPotentiallyUnwantedApps=1
  1579. dwDetectOptions    (DontDetectJokes)            = 0x00002000    =>    !DetectJokes=1
  1580. ---------------------------------------------------------------------------- */
  1581. insert PolicySettings
  1582. (ParentID, SectionName, SettingName, Value)
  1583. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailSpyware', 'DetectPotentiallyUnwantedApps', '0'
  1584. from PolicySettings b, #VirusScanPolicyIDs
  1585. where
  1586. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1587. and b.SectionName = 'Server_EmailAdvanced'
  1588. and b.SettingName = 'dwDetectOptions'
  1589.  
  1590. update PolicySettings
  1591. set Value = '1'
  1592. where
  1593. SectionName = 'Server_EmailSpyware'
  1594. and SettingName = 'DetectPotentiallyUnwantedApps'
  1595. and PolicySettings.parentid in 
  1596.     (select b.parentid
  1597.     from #VirusScanPolicyIDs, PolicySettings b
  1598.     where
  1599.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1600.     and b.SectionName = 'Server_EmailAdvanced'
  1601.     and b.SettingName = 'dwDetectOptions'
  1602.     and (convert(int,value) & 0x00004000) > 0
  1603.     )
  1604.  
  1605. insert PolicySettings
  1606. (ParentID, SectionName, SettingName, Value)
  1607. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailSpyware', 'DetectJokes', '1'
  1608. from PolicySettings b, #VirusScanPolicyIDs
  1609. where
  1610. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1611. and b.SectionName = 'Server_EmailAdvanced'
  1612. and b.SettingName = 'dwDetectOptions'
  1613.  
  1614. update PolicySettings
  1615. set Value = '0'
  1616. where
  1617. SectionName = 'Server_EmailSpyware'
  1618. and SettingName = 'DetectJokes'
  1619. and PolicySettings.parentid in 
  1620.     (select b.parentid
  1621.     from #VirusScanPolicyIDs, PolicySettings b
  1622.     where
  1623.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1624.     and b.SectionName = 'Server_EmailAdvanced'
  1625.     and b.SettingName = 'dwDetectOptions'
  1626.     and (convert(int,value) & 0x00002000) > 0
  1627.     )
  1628.  
  1629. delete PolicySettings 
  1630. where 
  1631. PolicySettings.SectionName = 'Server_EmailAdvanced'
  1632. and PolicySettings.SettingName = 'dwDetectOptions'
  1633. and PolicySettings.ParentID in 
  1634. (select 
  1635. AutoID 
  1636. from Policy, PolicySettings
  1637. where 
  1638. Policy.autoid = PolicySettings.parentid
  1639. and Policy.ProductCode = 'VIRUSCAN8700'
  1640. and Policy.ParentType in (6, 5, 4, 3, 1)
  1641. )
  1642.  
  1643. /* ----------------------------------------------------------------------------
  1644. [Wrkstn_EmailAdvanced]                                            [Wrkstn_EmailSpyware]
  1645. dwDetectOptions    (DetectPrograms)            = 0x00004000    =>    DetectPotentiallyUnwantedApps=1
  1646. dwDetectOptions    (DontDetectJokes)            = 0x00002000    =>    !DetectJokes=1
  1647. ---------------------------------------------------------------------------- */
  1648. insert PolicySettings
  1649. (ParentID, SectionName, SettingName, Value)
  1650. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailSpyware', 'DetectPotentiallyUnwantedApps', '0'
  1651. from PolicySettings b, #VirusScanPolicyIDs
  1652. where
  1653. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1654. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1655. and b.SettingName = 'dwDetectOptions'
  1656.  
  1657. update PolicySettings
  1658. set Value = '1'
  1659. where
  1660. SectionName = 'Wrkstn_EmailSpyware'
  1661. and SettingName = 'DetectPotentiallyUnwantedApps'
  1662. and PolicySettings.parentid in 
  1663.     (select b.parentid
  1664.     from #VirusScanPolicyIDs, PolicySettings b
  1665.     where
  1666.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1667.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1668.     and b.SettingName = 'dwDetectOptions'
  1669.     and (convert(int,value) & 0x00004000) > 0
  1670.     )
  1671.  
  1672. insert PolicySettings
  1673. (ParentID, SectionName, SettingName, Value)
  1674. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailSpyware', 'DetectJokes', '1'
  1675. from PolicySettings b, #VirusScanPolicyIDs
  1676. where
  1677. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1678. and b.SectionName = 'Wrkstn_EmailAdvanced'
  1679. and b.SettingName = 'dwDetectOptions'
  1680.  
  1681. update PolicySettings
  1682. set Value = '0'
  1683. where
  1684. SectionName = 'Wrkstn_EmailSpyware'
  1685. and SettingName = 'DetectJokes'
  1686. and PolicySettings.parentid in 
  1687.     (select b.parentid
  1688.     from #VirusScanPolicyIDs, PolicySettings b
  1689.     where
  1690.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1691.     and b.SectionName = 'Wrkstn_EmailAdvanced'
  1692.     and b.SettingName = 'dwDetectOptions'
  1693.     and (convert(int,value) & 0x00002000) > 0
  1694.     )
  1695.  
  1696. delete PolicySettings 
  1697. where 
  1698. PolicySettings.SectionName = 'Wrkstn_EmailAdvanced'
  1699. and PolicySettings.SettingName = 'dwDetectOptions'
  1700. and PolicySettings.ParentID in 
  1701. (select 
  1702. AutoID 
  1703. from Policy, PolicySettings
  1704. where 
  1705. Policy.autoid = PolicySettings.parentid
  1706. and Policy.ProductCode = 'VIRUSCAN8700'
  1707. and Policy.ParentType in (6, 5, 4, 3, 1)
  1708. )
  1709.  
  1710. /* ----------------------------------------------------------------------------
  1711. [Server_EmailAction]                                    [Server_EmailAction]
  1712. uScanAction                                            =>    uAction
  1713. uSecScanAction                                        =>    uSecAction
  1714.                         
  1715.                                 // old actions        =>    // new actions
  1716.                                 {                    {
  1717.                                     ACTION_PROMPT=0,    ACTION_CONTINUE=1,
  1718.                                     ACTION_MOVE,        ACTION_PROMPT,
  1719.                                     ACTION_DELETE,        ACTION_MOVE,
  1720.                                     ACTION_CONTINUE,    ACTION_DELETE, 
  1721.                                     ACTION_CLEAN        ACTION_CLEAN,
  1722.                                 }                    }
  1723. ---------------------------------------------------------------------------- */
  1724. insert PolicySettings
  1725. (ParentID, SectionName, SettingName, Value)
  1726. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAction', 'uAction', '0'
  1727. from PolicySettings b, #VirusScanPolicyIDs
  1728. where
  1729. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1730. and b.SectionName = 'Server_EmailAction'
  1731. and b.SettingName = 'uScanAction'
  1732.  
  1733. -- ACTION_PROMPT
  1734. update PolicySettings
  1735. set Value = '2'
  1736. where
  1737. SectionName = 'Server_EmailAction'
  1738. and SettingName = 'uAction'
  1739. and PolicySettings.parentid in 
  1740.     (select b.parentid
  1741.     from #VirusScanPolicyIDs, PolicySettings b
  1742.     where
  1743.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1744.     and b.SectionName = 'Server_EmailAction'
  1745.     and b.SettingName = 'uScanAction'
  1746.     and b.Value = '0'
  1747.     )
  1748.  
  1749. -- ACTION_MOVE
  1750. update PolicySettings
  1751. set Value = '3'
  1752. where
  1753. SectionName = 'Server_EmailAction'
  1754. and SettingName = 'uAction'
  1755. and PolicySettings.parentid in 
  1756.     (select b.parentid
  1757.     from #VirusScanPolicyIDs, PolicySettings b
  1758.     where
  1759.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1760.     and b.SectionName = 'Server_EmailAction'
  1761.     and b.SettingName = 'uScanAction'
  1762.     and b.Value = '1'
  1763.     )
  1764.  
  1765. -- ACTION_DELETE
  1766. update PolicySettings
  1767. set Value = '4'
  1768. where
  1769. SectionName = 'Server_EmailAction'
  1770. and SettingName = 'uAction'
  1771. and PolicySettings.parentid in 
  1772.     (select b.parentid
  1773.     from #VirusScanPolicyIDs, PolicySettings b
  1774.     where
  1775.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1776.     and b.SectionName = 'Server_EmailAction'
  1777.     and b.SettingName = 'uScanAction'
  1778.     and b.Value = '2'
  1779.     )
  1780.  
  1781. -- ACTION_CLEAN
  1782. update PolicySettings
  1783. set Value = '5'
  1784. where
  1785. SectionName = 'Server_EmailAction'
  1786. and SettingName = 'uAction'
  1787. and PolicySettings.parentid in 
  1788.     (select b.parentid
  1789.     from #VirusScanPolicyIDs, PolicySettings b
  1790.     where
  1791.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1792.     and b.SectionName = 'Server_EmailAction'
  1793.     and b.SettingName = 'uScanAction'
  1794.     and b.Value = '4'
  1795.     )
  1796.  
  1797. -- ACTION_CONTINUE
  1798. update PolicySettings
  1799. set Value = '1'
  1800. where
  1801. SectionName = 'Server_EmailAction'
  1802. and SettingName = 'uAction'
  1803. and PolicySettings.parentid in 
  1804.     (select b.parentid
  1805.     from #VirusScanPolicyIDs, PolicySettings b
  1806.     where
  1807.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1808.     and b.SectionName = 'Server_EmailAction'
  1809.     and b.SettingName = 'uScanAction'
  1810.     and b.Value = '3'
  1811.     )
  1812.  
  1813. insert PolicySettings
  1814. (ParentID, SectionName, SettingName, Value)
  1815. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailAction', 'uSecAction', '0'
  1816. from PolicySettings b, #VirusScanPolicyIDs
  1817. where
  1818. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1819. and b.SectionName = 'Server_EmailAction'
  1820. and b.SettingName = 'uSecScanAction'
  1821.  
  1822. -- ACTION_PROMPT
  1823. update PolicySettings
  1824. set Value = '2'
  1825. where
  1826. SectionName = 'Server_EmailAction'
  1827. and SettingName = 'uSecAction'
  1828. and PolicySettings.parentid in 
  1829.     (select b.parentid
  1830.     from #VirusScanPolicyIDs, PolicySettings b
  1831.     where
  1832.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1833.     and b.SectionName = 'Server_EmailAction'
  1834.     and b.SettingName = 'uSecScanAction'
  1835.     and b.Value = '0'
  1836.     )
  1837.  
  1838. -- ACTION_MOVE
  1839. update PolicySettings
  1840. set Value = '3'
  1841. where
  1842. SectionName = 'Server_EmailAction'
  1843. and SettingName = 'uSecAction'
  1844. and PolicySettings.parentid in 
  1845.     (select b.parentid
  1846.     from #VirusScanPolicyIDs, PolicySettings b
  1847.     where
  1848.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1849.     and b.SectionName = 'Server_EmailAction'
  1850.     and b.SettingName = 'uSecScanAction'
  1851.     and b.Value = '1'
  1852.     )
  1853.  
  1854. -- ACTION_DELETE
  1855. update PolicySettings
  1856. set Value = '4'
  1857. where
  1858. SectionName = 'Server_EmailAction'
  1859. and SettingName = 'uSecAction'
  1860. and PolicySettings.parentid in 
  1861.     (select b.parentid
  1862.     from #VirusScanPolicyIDs, PolicySettings b
  1863.     where
  1864.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1865.     and b.SectionName = 'Server_EmailAction'
  1866.     and b.SettingName = 'uSecScanAction'
  1867.     and b.Value = '2'
  1868.     )
  1869.  
  1870. -- ACTION_CLEAN
  1871. update PolicySettings
  1872. set Value = '5'
  1873. where
  1874. SectionName = 'Server_EmailAction'
  1875. and SettingName = 'uSecAction'
  1876. and PolicySettings.parentid in 
  1877.     (select b.parentid
  1878.     from #VirusScanPolicyIDs, PolicySettings b
  1879.     where
  1880.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1881.     and b.SectionName = 'Server_EmailAction'
  1882.     and b.SettingName = 'uSecScanAction'
  1883.     and b.Value = '4'
  1884.     )
  1885.  
  1886. -- ACTION_CONTINUE
  1887. update PolicySettings
  1888. set Value = '1'
  1889. where
  1890. SectionName = 'Server_EmailAction'
  1891. and SettingName = 'uSecAction'
  1892. and PolicySettings.parentid in 
  1893.     (select b.parentid
  1894.     from #VirusScanPolicyIDs, PolicySettings b
  1895.     where
  1896.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1897.     and b.SectionName = 'Server_EmailAction'
  1898.     and b.SettingName = 'uSecScanAction'
  1899.     and b.Value = '3'
  1900.     )
  1901.  
  1902. delete PolicySettings 
  1903. where 
  1904. PolicySettings.SectionName = 'Server_EmailAction'
  1905. and PolicySettings.SettingName = 'uScanAction'
  1906. and PolicySettings.ParentID in 
  1907. (select 
  1908. AutoID 
  1909. from Policy, PolicySettings
  1910. where 
  1911. Policy.autoid = PolicySettings.parentid
  1912. and Policy.ProductCode = 'VIRUSCAN8700'
  1913. and Policy.ParentType in (6, 5, 4, 3, 1)
  1914. )
  1915.  
  1916. delete PolicySettings 
  1917. where 
  1918. PolicySettings.SectionName = 'Server_EmailAction'
  1919. and PolicySettings.SettingName = 'uSecScanAction'
  1920. and PolicySettings.ParentID in 
  1921. (select 
  1922. AutoID 
  1923. from Policy, PolicySettings
  1924. where 
  1925. Policy.autoid = PolicySettings.parentid
  1926. and Policy.ProductCode = 'VIRUSCAN8700'
  1927. and Policy.ParentType in (6, 5, 4, 3, 1)
  1928. )
  1929.  
  1930. /* ----------------------------------------------------------------------------
  1931. [Wrkstn_EmailAction]                                    [Wrkstn_EmailAction]
  1932. uScanAction                                            =>    uAction
  1933. uSecScanAction                                        =>    uSecAction
  1934.  
  1935.                                 // old actions        =>    // new actions
  1936.                                 {                    {
  1937.                                     ACTION_PROMPT=0,    ACTION_CONTINUE=1,
  1938.                                     ACTION_MOVE,        ACTION_PROMPT,
  1939.                                     ACTION_DELETE,        ACTION_MOVE,
  1940.                                     ACTION_CONTINUE,    ACTION_DELETE, 
  1941.                                     ACTION_CLEAN        ACTION_CLEAN,
  1942.                                 }                    }                                
  1943. ---------------------------------------------------------------------------- */
  1944. insert PolicySettings
  1945. (ParentID, SectionName, SettingName, Value)
  1946. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAction', 'uAction', '0'
  1947. from PolicySettings b, #VirusScanPolicyIDs
  1948. where
  1949. b.ParentID = #VirusScanPolicyIDs.AutoID2
  1950. and b.SectionName = 'Wrkstn_EmailAction'
  1951. and b.SettingName = 'uScanAction'
  1952.  
  1953. -- ACTION_PROMPT
  1954. update PolicySettings
  1955. set Value = '2'
  1956. where
  1957. SectionName = 'Wrkstn_EmailAction'
  1958. and SettingName = 'uAction'
  1959. and PolicySettings.parentid in 
  1960.     (select b.parentid
  1961.     from #VirusScanPolicyIDs, PolicySettings b
  1962.     where
  1963.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1964.     and b.SectionName = 'Wrkstn_EmailAction'
  1965.     and b.SettingName = 'uScanAction'
  1966.     and b.Value = '0'
  1967.     )
  1968.  
  1969. -- ACTION_MOVE
  1970. update PolicySettings
  1971. set Value = '3'
  1972. where
  1973. SectionName = 'Wrkstn_EmailAction'
  1974. and SettingName = 'uAction'
  1975. and PolicySettings.parentid in 
  1976.     (select b.parentid
  1977.     from #VirusScanPolicyIDs, PolicySettings b
  1978.     where
  1979.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1980.     and b.SectionName = 'Wrkstn_EmailAction'
  1981.     and b.SettingName = 'uScanAction'
  1982.     and b.Value = '1'
  1983.     )
  1984.  
  1985. -- ACTION_DELETE
  1986. update PolicySettings
  1987. set Value = '4'
  1988. where
  1989. SectionName = 'Wrkstn_EmailAction'
  1990. and SettingName = 'uAction'
  1991. and PolicySettings.parentid in 
  1992.     (select b.parentid
  1993.     from #VirusScanPolicyIDs, PolicySettings b
  1994.     where
  1995.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  1996.     and b.SectionName = 'Wrkstn_EmailAction'
  1997.     and b.SettingName = 'uScanAction'
  1998.     and b.Value = '2'
  1999.     )
  2000.  
  2001. -- ACTION_CLEAN
  2002. update PolicySettings
  2003. set Value = '5'
  2004. where
  2005. SectionName = 'Wrkstn_EmailAction'
  2006. and SettingName = 'uAction'
  2007. and PolicySettings.parentid in 
  2008.     (select b.parentid
  2009.     from #VirusScanPolicyIDs, PolicySettings b
  2010.     where
  2011.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2012.     and b.SectionName = 'Wrkstn_EmailAction'
  2013.     and b.SettingName = 'uScanAction'
  2014.     and b.Value = '4'
  2015.     )
  2016.  
  2017. -- ACTION_CONTINUE
  2018. update PolicySettings
  2019. set Value = '1'
  2020. where
  2021. SectionName = 'Wrkstn_EmailAction'
  2022. and SettingName = 'uAction'
  2023. and PolicySettings.parentid in 
  2024.     (select b.parentid
  2025.     from #VirusScanPolicyIDs, PolicySettings b
  2026.     where
  2027.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2028.     and b.SectionName = 'Wrkstn_EmailAction'
  2029.     and b.SettingName = 'uScanAction'
  2030.     and b.Value = '3'
  2031.     )
  2032.  
  2033. insert PolicySettings
  2034. (ParentID, SectionName, SettingName, Value)
  2035. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_EmailAction', 'uSecAction', '0'
  2036. from PolicySettings b, #VirusScanPolicyIDs
  2037. where
  2038. b.ParentID = #VirusScanPolicyIDs.AutoID2
  2039. and b.SectionName = 'Wrkstn_EmailAction'
  2040. and b.SettingName = 'uSecScanAction'
  2041.  
  2042. -- ACTION_PROMPT
  2043. update PolicySettings
  2044. set Value = '2'
  2045. where
  2046. SectionName = 'Wrkstn_EmailAction'
  2047. and SettingName = 'uSecAction'
  2048. and PolicySettings.parentid in 
  2049.     (select b.parentid
  2050.     from #VirusScanPolicyIDs, PolicySettings b
  2051.     where
  2052.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2053.     and b.SectionName = 'Wrkstn_EmailAction'
  2054.     and b.SettingName = 'uSecScanAction'
  2055.     and b.Value = '0'
  2056.     )
  2057.  
  2058. -- ACTION_MOVE
  2059. update PolicySettings
  2060. set Value = '3'
  2061. where
  2062. SectionName = 'Wrkstn_EmailAction'
  2063. and SettingName = 'uSecAction'
  2064. and PolicySettings.parentid in 
  2065.     (select b.parentid
  2066.     from #VirusScanPolicyIDs, PolicySettings b
  2067.     where
  2068.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2069.     and b.SectionName = 'Wrkstn_EmailAction'
  2070.     and b.SettingName = 'uSecScanAction'
  2071.     and b.Value = '1'
  2072.     )
  2073.  
  2074. -- ACTION_DELETE
  2075. update PolicySettings
  2076. set Value = '4'
  2077. where
  2078. SectionName = 'Wrkstn_EmailAction'
  2079. and SettingName = 'uSecAction'
  2080. and PolicySettings.parentid in 
  2081.     (select b.parentid
  2082.     from #VirusScanPolicyIDs, PolicySettings b
  2083.     where
  2084.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2085.     and b.SectionName = 'Wrkstn_EmailAction'
  2086.     and b.SettingName = 'uSecScanAction'
  2087.     and b.Value = '2'
  2088.     )
  2089.  
  2090. -- ACTION_CLEAN
  2091. update PolicySettings
  2092. set Value = '5'
  2093. where
  2094. SectionName = 'Wrkstn_EmailAction'
  2095. and SettingName = 'uSecAction'
  2096. and PolicySettings.parentid in 
  2097.     (select b.parentid
  2098.     from #VirusScanPolicyIDs, PolicySettings b
  2099.     where
  2100.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2101.     and b.SectionName = 'Wrkstn_EmailAction'
  2102.     and b.SettingName = 'uSecScanAction'
  2103.     and b.Value = '4'
  2104.     )
  2105.  
  2106. -- ACTION_CONTINUE
  2107. update PolicySettings
  2108. set Value = '1'
  2109. where
  2110. SectionName = 'Wrkstn_EmailAction'
  2111. and SettingName = 'uSecAction'
  2112. and PolicySettings.parentid in 
  2113.     (select b.parentid
  2114.     from #VirusScanPolicyIDs, PolicySettings b
  2115.     where
  2116.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2117.     and b.SectionName = 'Wrkstn_EmailAction'
  2118.     and b.SettingName = 'uSecScanAction'
  2119.     and b.Value = '3'
  2120.     )
  2121.  
  2122. delete PolicySettings 
  2123. where 
  2124. PolicySettings.SectionName = 'Wrkstn_EmailAction'
  2125. and PolicySettings.SettingName = 'uScanAction'
  2126. and PolicySettings.ParentID in 
  2127. (select 
  2128. AutoID 
  2129. from Policy, PolicySettings
  2130. where 
  2131. Policy.autoid = PolicySettings.parentid
  2132. and Policy.ProductCode = 'VIRUSCAN8700'
  2133. and Policy.ParentType in (6, 5, 4, 3, 1)
  2134. )
  2135.  
  2136. delete PolicySettings 
  2137. where 
  2138. PolicySettings.SectionName = 'Wrkstn_EmailAction'
  2139. and PolicySettings.SettingName = 'uSecScanAction'
  2140. and PolicySettings.ParentID in 
  2141. (select 
  2142. AutoID 
  2143. from Policy, PolicySettings
  2144. where 
  2145. Policy.autoid = PolicySettings.parentid
  2146. and Policy.ProductCode = 'VIRUSCAN8700'
  2147. and Policy.ParentType in (6, 5, 4, 3, 1)
  2148. )
  2149.  
  2150. /* ----------------------------------------------------------------------------
  2151. [Server_EmailAction]                                    [Server_EmailAction]
  2152. dwPromptButton                                        =>    |= 0x00000020 (Delete Mail)
  2153. ---------------------------------------------------------------------------- */
  2154. update PolicySettings
  2155. set Value = convert(int,Value) | 0x00000020
  2156. where
  2157. SectionName = 'Server_EmailAction'
  2158. and SettingName = 'dwPromptButton'
  2159. and PolicySettings.parentid in 
  2160.     (select b.parentid
  2161.     from #VirusScanPolicyIDs, PolicySettings b
  2162.     where
  2163.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2164.     and b.SectionName = 'Server_EmailAction'
  2165.     and b.SettingName = 'dwPromptButton'
  2166.     )
  2167.     
  2168. /* ----------------------------------------------------------------------------
  2169. [Wrkstn_EmailAction]                                    [Wrkstn_EmailAction]
  2170. dwPromptButton                                        =>    |= 0x00000020 (Delete Mail)
  2171. ---------------------------------------------------------------------------- */
  2172. update PolicySettings
  2173. set Value = convert(int,Value) | 0x00000020
  2174. where
  2175. SectionName = 'Wrkstn_EmailAction'
  2176. and SettingName = 'dwPromptButton'
  2177. and PolicySettings.parentid in 
  2178.     (select b.parentid
  2179.     from #VirusScanPolicyIDs, PolicySettings b
  2180.     where
  2181.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2182.     and b.SectionName = 'Wrkstn_EmailAction'
  2183.     and b.SettingName = 'dwPromptButton'
  2184.     )
  2185.     
  2186. /* ----------------------------------------------------------------------------
  2187. [Server_EmailAction]
  2188. -szSecMoveFolder
  2189. ---------------------------------------------------------------------------- */
  2190. delete PolicySettings 
  2191. where 
  2192. PolicySettings.SectionName = 'Server_EmailAction'
  2193. and PolicySettings.SettingName = 'szSecMoveFolder'
  2194. and PolicySettings.ParentID in 
  2195. (select 
  2196. AutoID 
  2197. from Policy, PolicySettings
  2198. where 
  2199. Policy.autoid = PolicySettings.parentid
  2200. and Policy.ProductCode = 'VIRUSCAN8700'
  2201. and Policy.ParentType in (6, 5, 4, 3, 1)
  2202. )
  2203.  
  2204. /* ----------------------------------------------------------------------------
  2205. [Wrkstn_EmailAction]
  2206. -szSecMoveFolder
  2207. ---------------------------------------------------------------------------- */
  2208. delete PolicySettings 
  2209. where 
  2210. PolicySettings.SectionName = 'Wrkstn_EmailAction'
  2211. and PolicySettings.SettingName = 'szSecMoveFolder'
  2212. and PolicySettings.ParentID in 
  2213. (select 
  2214. AutoID 
  2215. from Policy, PolicySettings
  2216. where 
  2217. Policy.autoid = PolicySettings.parentid
  2218. and Policy.ProductCode = 'VIRUSCAN8700'
  2219. and Policy.ParentType in (6, 5, 4, 3, 1)
  2220. )
  2221.  
  2222. /* ----------------------------------------------------------------------------
  2223. [Server_EmailAction]
  2224. -dwPromptButton2
  2225. ---------------------------------------------------------------------------- */
  2226. delete PolicySettings 
  2227. where 
  2228. PolicySettings.SectionName = 'Server_EmailAction'
  2229. and PolicySettings.SettingName = 'dwPromptButton2'
  2230. and PolicySettings.ParentID in 
  2231. (select 
  2232. AutoID 
  2233. from Policy, PolicySettings
  2234. where 
  2235. Policy.autoid = PolicySettings.parentid
  2236. and Policy.ProductCode = 'VIRUSCAN8700'
  2237. and Policy.ParentType in (6, 5, 4, 3, 1)
  2238. )
  2239.  
  2240. /* ----------------------------------------------------------------------------
  2241. [Wrkstn_EmailAction]
  2242. -dwPromptButton2
  2243. ---------------------------------------------------------------------------- */
  2244. delete PolicySettings 
  2245. where 
  2246. PolicySettings.SectionName = 'Wrkstn_EmailAction'
  2247. and PolicySettings.SettingName = 'dwPromptButton2'
  2248. and PolicySettings.ParentID in 
  2249. (select 
  2250. AutoID 
  2251. from Policy, PolicySettings
  2252. where 
  2253. Policy.autoid = PolicySettings.parentid
  2254. and Policy.ProductCode = 'VIRUSCAN8700'
  2255. and Policy.ParentType in (6, 5, 4, 3, 1)
  2256. )
  2257.  
  2258. /* ----------------------------------------------------------------------------
  2259. [Server_EmailReport]                                    [Server_EmailReport]
  2260. uMaxKilobytes                                         =>    dwMaxLogSizeMB
  2261. ---------------------------------------------------------------------------- */
  2262. insert PolicySettings
  2263. (ParentID, SectionName, SettingName, Value)
  2264. select #VirusScanPolicyIDs.AutoID3, 'Server_EmailReport', 'dwMaxLogSizeMB', Value
  2265. from PolicySettings, #VirusScanPolicyIDs
  2266. where
  2267. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  2268. and SectionName = 'Server_EmailReport'
  2269. and SettingName = 'uMaxKilobytes'
  2270.  
  2271. delete PolicySettings
  2272. where
  2273. PolicySettings.SectionName = 'Server_EmailReport'
  2274. and PolicySettings.SettingName = 'uMaxKilobytes'
  2275. and PolicySettings.ParentID in
  2276. (select
  2277. AutoID
  2278. from Policy, PolicySettings
  2279. where
  2280. Policy.autoid = PolicySettings.parentid
  2281. and Policy.ProductCode = 'VIRUSCAN8700'
  2282. and Policy.ParentType in (6, 5, 4, 3, 1)
  2283. )
  2284.  
  2285. /* ----------------------------------------------------------------------------
  2286. [WrkStn_EmailReport]                                    [WrkStn_EmailReport]
  2287. uMaxKilobytes                                         =>    dwMaxLogSizeMB
  2288. ---------------------------------------------------------------------------- */
  2289. insert PolicySettings
  2290. (ParentID, SectionName, SettingName, Value)
  2291. select #VirusScanPolicyIDs.AutoID3, 'WrkStn_EmailReport', 'dwMaxLogSizeMB', Value
  2292. from PolicySettings, #VirusScanPolicyIDs
  2293. where
  2294. PolicySettings.ParentID = #VirusScanPolicyIDs.AutoID2
  2295. and SectionName = 'WrkStn_EmailReport'
  2296. and SettingName = 'uMaxKilobytes'
  2297.  
  2298. delete PolicySettings 
  2299. where 
  2300. PolicySettings.SectionName = 'WrkStn_EmailReport'
  2301. and PolicySettings.SettingName = 'uMaxKilobytes'
  2302. and PolicySettings.ParentID in 
  2303. (select 
  2304. AutoID 
  2305. from Policy, PolicySettings
  2306. where 
  2307. Policy.autoid = PolicySettings.parentid
  2308. and Policy.ProductCode = 'VIRUSCAN8700'
  2309. and Policy.ParentType in (6, 5, 4, 3, 1)
  2310. )
  2311.  
  2312. /* ----------------------------------------------------------------------------
  2313. [Server_UIOptions]
  2314. -dwConsoleRefreshRate
  2315. ---------------------------------------------------------------------------- */
  2316. delete PolicySettings 
  2317. where 
  2318. PolicySettings.SectionName = 'Server_UIOptions'
  2319. and PolicySettings.SettingName = 'dwConsoleRefreshRate'
  2320. and PolicySettings.ParentID in 
  2321. (select 
  2322. AutoID 
  2323. from Policy, PolicySettings
  2324. where 
  2325. Policy.autoid = PolicySettings.parentid
  2326. and Policy.ProductCode = 'VIRUSCAN8700'
  2327. and Policy.ParentType in (6, 5, 4, 3, 1)
  2328. )
  2329.  
  2330. /* ----------------------------------------------------------------------------
  2331. [WrkStn_UIOptions]
  2332. -dwConsoleRefreshRate
  2333. ---------------------------------------------------------------------------- */
  2334. delete PolicySettings 
  2335. where 
  2336. PolicySettings.SectionName = 'WrkStn_UIOptions'
  2337. and PolicySettings.SettingName = 'dwConsoleRefreshRate'
  2338. and PolicySettings.ParentID in 
  2339. (select 
  2340. AutoID 
  2341. from Policy, PolicySettings
  2342. where 
  2343. Policy.autoid = PolicySettings.parentid
  2344. and Policy.ProductCode = 'VIRUSCAN8700'
  2345. and Policy.ParentType in (6, 5, 4, 3, 1)
  2346. )
  2347.  
  2348. /* ----------------------------------------------------------------------------
  2349. [Server_Trusted-Action]                                            [Server_Trusted-Action]
  2350. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  2351. uSecAction                                                    =>  = 7 (Deny)
  2352. ---------------------------------------------------------------------------- */
  2353. update PolicySettings
  2354. set Value = '7'
  2355. where
  2356. SectionName = 'Server_Trusted-Action'
  2357. and SettingName = 'uSecAction'
  2358. and PolicySettings.parentid in 
  2359.     (select b.parentid
  2360.     from #VirusScanPolicyIDs, PolicySettings b
  2361.     where
  2362.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2363.     and b.SectionName = 'Server_Trusted-Action'
  2364.     and b.SettingName = 'uAction'
  2365.     and b.Value = '3'
  2366.     )
  2367.  
  2368. update PolicySettings
  2369. set Value = '4'
  2370. where
  2371. SectionName = 'Server_Trusted-Action'
  2372. and SettingName = 'uAction'
  2373. and PolicySettings.parentid in 
  2374.     (select b.parentid
  2375.     from #VirusScanPolicyIDs, PolicySettings b
  2376.     where
  2377.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2378.     and b.SectionName = 'Server_Trusted-Action'
  2379.     and b.SettingName = 'uAction'
  2380.     and b.Value = '3'
  2381.     )
  2382.  
  2383. /* ----------------------------------------------------------------------------
  2384. [Wrkstn_Trusted-Action]                                            [Wrkstn_Trusted-Action]
  2385. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  2386. uSecAction                                                    =>  = 7 (Deny)
  2387. ---------------------------------------------------------------------------- */
  2388. update PolicySettings
  2389. set Value = '7'
  2390. where
  2391. SectionName = 'Wrkstn_Trusted-Action'
  2392. and SettingName = 'uSecAction'
  2393. and PolicySettings.parentid in 
  2394.     (select b.parentid
  2395.     from #VirusScanPolicyIDs, PolicySettings b
  2396.     where
  2397.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2398.     and b.SectionName = 'Wrkstn_Trusted-Action'
  2399.     and b.SettingName = 'uAction'
  2400.     and b.Value = '3'
  2401.     )
  2402.  
  2403. update PolicySettings
  2404. set Value = '4'
  2405. where
  2406. SectionName = 'Wrkstn_Trusted-Action'
  2407. and SettingName = 'uAction'
  2408. and PolicySettings.parentid in 
  2409.     (select b.parentid
  2410.     from #VirusScanPolicyIDs, PolicySettings b
  2411.     where
  2412.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2413.     and b.SectionName = 'Wrkstn_Trusted-Action'
  2414.     and b.SettingName = 'uAction'
  2415.     and b.Value = '3'
  2416.     )
  2417.  
  2418. /* ----------------------------------------------------------------------------
  2419. [Server_Trusted-Action]                                            [Server_Trusted-Action]
  2420. uAction                                        = 5    (Clean)
  2421. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  2422. ---------------------------------------------------------------------------- */
  2423. update PolicySettings
  2424. set Value = '4'
  2425. where
  2426. SectionName = 'Server_Trusted-Action'
  2427. and SettingName = 'uSecAction'
  2428. and PolicySettings.parentid in 
  2429.     (select b.parentid
  2430.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2431.     where
  2432.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2433.     and b.SectionName = 'Server_Trusted-Action'
  2434.     and b.SettingName = 'uAction'
  2435.     and b.Value = '5'
  2436.     and b.ParentID = c.ParentID
  2437.     and c.SectionName = 'Server_Trusted-Action'
  2438.     and c.SettingName = 'uSecAction'
  2439.     and c.Value = '3'
  2440.     )
  2441.  
  2442. /* ----------------------------------------------------------------------------
  2443. [Wrkstn_Trusted-Action]                                            [Wrkstn_Trusted-Action]
  2444. uAction                                        = 5    (Clean)
  2445. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  2446. ---------------------------------------------------------------------------- */
  2447. update PolicySettings
  2448. set Value = '4'
  2449. where
  2450. SectionName = 'Wrkstn_Trusted-Action'
  2451. and SettingName = 'uSecAction'
  2452. and PolicySettings.parentid in 
  2453.     (select b.parentid
  2454.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2455.     where
  2456.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2457.     and b.SectionName = 'Wrkstn_Trusted-Action'
  2458.     and b.SettingName = 'uAction'
  2459.     and b.Value = '5'
  2460.     and b.ParentID = c.ParentID
  2461.     and c.SectionName = 'Wrkstn_Trusted-Action'
  2462.     and c.SettingName = 'uSecAction'
  2463.     and c.Value = '3'
  2464.     )
  2465.  
  2466. /* ----------------------------------------------------------------------------
  2467. [Server_Trusted-Action]                                            [Server_Trusted-Action]
  2468. uAction                                        = 4    (Delete)
  2469. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  2470. ---------------------------------------------------------------------------- */
  2471. update PolicySettings
  2472. set Value = '7'
  2473. where
  2474. SectionName = 'Server_Trusted-Action'
  2475. and SettingName = 'uSecAction'
  2476. and PolicySettings.parentid in 
  2477.     (select b.parentid
  2478.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2479.     where
  2480.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2481.     and b.SectionName = 'Server_Trusted-Action'
  2482.     and b.SettingName = 'uAction'
  2483.     and b.Value = '4'
  2484.     and b.ParentID = c.ParentID
  2485.     and c.SectionName = 'Server_Trusted-Action'
  2486.     and c.SettingName = 'uSecAction'
  2487.     and c.Value = '3'
  2488.     )
  2489.  
  2490. /* ----------------------------------------------------------------------------
  2491. [Wrkstn_Trusted-Action]                                            [Wrkstn_Trusted-Action]
  2492. uAction                                        = 4    (Delete)
  2493. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  2494. ---------------------------------------------------------------------------- */
  2495. update PolicySettings
  2496. set Value = '7'
  2497. where
  2498. SectionName = 'Wrkstn_Trusted-Action'
  2499. and SettingName = 'uSecAction'
  2500. and PolicySettings.parentid in 
  2501.     (select b.parentid
  2502.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2503.     where
  2504.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2505.     and b.SectionName = 'Wrkstn_Trusted-Action'
  2506.     and b.SettingName = 'uAction'
  2507.     and b.Value = '4'
  2508.     and b.ParentID = c.ParentID
  2509.     and c.SectionName = 'Wrkstn_Trusted-Action'
  2510.     and c.SettingName = 'uSecAction'
  2511.     and c.Value = '3'
  2512.     )
  2513.  
  2514. /* ----------------------------------------------------------------------------
  2515. [Server_Untrusted-Action]                                        [Server_Untrusted-Action]
  2516. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  2517. uSecAction                                                    =>  = 7 (Deny)
  2518. ---------------------------------------------------------------------------- */
  2519. update PolicySettings
  2520. set Value = '7'
  2521. where
  2522. SectionName = 'Server_Untrusted-Action'
  2523. and SettingName = 'uSecAction'
  2524. and PolicySettings.parentid in 
  2525.     (select b.parentid
  2526.     from #VirusScanPolicyIDs, PolicySettings b
  2527.     where
  2528.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2529.     and b.SectionName = 'Server_Untrusted-Action'
  2530.     and b.SettingName = 'uAction'
  2531.     and b.Value = '3'
  2532.     )
  2533.  
  2534. update PolicySettings
  2535. set Value = '4'
  2536. where
  2537. SectionName = 'Server_Untrusted-Action'
  2538. and SettingName = 'uAction'
  2539. and PolicySettings.parentid in 
  2540.     (select b.parentid
  2541.     from #VirusScanPolicyIDs, PolicySettings b
  2542.     where
  2543.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2544.     and b.SectionName = 'Server_Untrusted-Action'
  2545.     and b.SettingName = 'uAction'
  2546.     and b.Value = '3'
  2547.     )
  2548.  
  2549. /* ----------------------------------------------------------------------------
  2550. [Wrkstn_Untrusted-Action]                                        [Wrkstn_Untrusted-Action]
  2551. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  2552. uSecAction                                                    =>  = 7 (Deny)
  2553. ---------------------------------------------------------------------------- */
  2554. update PolicySettings
  2555. set Value = '7'
  2556. where
  2557. SectionName = 'Wrkstn_Untrusted-Action'
  2558. and SettingName = 'uSecAction'
  2559. and PolicySettings.parentid in 
  2560.     (select b.parentid
  2561.     from #VirusScanPolicyIDs, PolicySettings b
  2562.     where
  2563.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2564.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  2565.     and b.SettingName = 'uAction'
  2566.     and b.Value = '3'
  2567.     )
  2568.  
  2569. update PolicySettings
  2570. set Value = '4'
  2571. where
  2572. SectionName = 'Wrkstn_Untrusted-Action'
  2573. and SettingName = 'uAction'
  2574. and PolicySettings.parentid in 
  2575.     (select b.parentid
  2576.     from #VirusScanPolicyIDs, PolicySettings b
  2577.     where
  2578.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2579.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  2580.     and b.SettingName = 'uAction'
  2581.     and b.Value = '3'
  2582.     )
  2583.  
  2584. /* ----------------------------------------------------------------------------
  2585. [Server_Untrusted-Action]                                        [Server_Untrusted-Action]
  2586. uAction                                        = 5    (Clean)
  2587. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  2588. ---------------------------------------------------------------------------- */
  2589. update PolicySettings
  2590. set Value = '4'
  2591. where
  2592. SectionName = 'Server_Untrusted-Action'
  2593. and SettingName = 'uSecAction'
  2594. and PolicySettings.parentid in 
  2595.     (select b.parentid
  2596.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2597.     where
  2598.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2599.     and b.SectionName = 'Server_Untrusted-Action'
  2600.     and b.SettingName = 'uAction'
  2601.     and b.Value = '5'
  2602.     and b.ParentID = c.ParentID
  2603.     and c.SectionName = 'Server_Untrusted-Action'
  2604.     and c.SettingName = 'uSecAction'
  2605.     and c.Value = '3'
  2606.     )
  2607.  
  2608. /* ----------------------------------------------------------------------------
  2609. [Wrkstn_Untrusted-Action]                                        [Wrkstn_Untrusted-Action]
  2610. uAction                                        = 5    (Clean)
  2611. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  2612. ---------------------------------------------------------------------------- */
  2613. update PolicySettings
  2614. set Value = '4'
  2615. where
  2616. SectionName = 'Wrkstn_Untrusted-Action'
  2617. and SettingName = 'uSecAction'
  2618. and PolicySettings.parentid in 
  2619.     (select b.parentid
  2620.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2621.     where
  2622.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2623.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  2624.     and b.SettingName = 'uAction'
  2625.     and b.Value = '5'
  2626.     and b.ParentID = c.ParentID
  2627.     and c.SectionName = 'Wrkstn_Untrusted-Action'
  2628.     and c.SettingName = 'uSecAction'
  2629.     and c.Value = '3'
  2630.     )
  2631.  
  2632. /* ----------------------------------------------------------------------------
  2633. [Server_Untrusted-Action]                                        [Server_Untrusted-Action]
  2634. uAction                                        = 4    (Delete)
  2635. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  2636. ---------------------------------------------------------------------------- */
  2637. update PolicySettings
  2638. set Value = '7'
  2639. where
  2640. SectionName = 'Server_Untrusted-Action'
  2641. and SettingName = 'uSecAction'
  2642. and PolicySettings.parentid in 
  2643.     (select b.parentid
  2644.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2645.     where
  2646.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2647.     and b.SectionName = 'Server_Untrusted-Action'
  2648.     and b.SettingName = 'uAction'
  2649.     and b.Value = '4'
  2650.     and b.ParentID = c.ParentID
  2651.     and c.SectionName = 'Server_Untrusted-Action'
  2652.     and c.SettingName = 'uSecAction'
  2653.     and c.Value = '3'
  2654.     )
  2655.  
  2656. /* ----------------------------------------------------------------------------
  2657. [Wrkstn_Untrusted-Action]                                        [Wrkstn_Untrusted-Action]
  2658. uAction                                        = 4    (Delete)
  2659. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  2660. ---------------------------------------------------------------------------- */
  2661. update PolicySettings
  2662. set Value = '7'
  2663. where
  2664. SectionName = 'Wrkstn_Untrusted-Action'
  2665. and SettingName = 'uSecAction'
  2666. and PolicySettings.parentid in 
  2667.     (select b.parentid
  2668.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2669.     where
  2670.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2671.     and b.SectionName = 'Wrkstn_Untrusted-Action'
  2672.     and b.SettingName = 'uAction'
  2673.     and b.Value = '4'
  2674.     and b.ParentID = c.ParentID
  2675.     and c.SectionName = 'Wrkstn_Untrusted-Action'
  2676.     and c.SettingName = 'uSecAction'
  2677.     and c.Value = '3'
  2678.     )
  2679.  
  2680. /* ----------------------------------------------------------------------------
  2681. [Server_Default-Action]                                            [Server_Default-Action]
  2682. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  2683. uSecAction                                                    =>  = 7 (Deny)
  2684. ---------------------------------------------------------------------------- */
  2685. update PolicySettings
  2686. set Value = '7'
  2687. where
  2688. SectionName = 'Server_Default-Action'
  2689. and SettingName = 'uSecAction'
  2690. and PolicySettings.parentid in 
  2691.     (select b.parentid
  2692.     from #VirusScanPolicyIDs, PolicySettings b
  2693.     where
  2694.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2695.     and b.SectionName = 'Server_Default-Action'
  2696.     and b.SettingName = 'uAction'
  2697.     and b.Value = '3'
  2698.     )
  2699.  
  2700. update PolicySettings
  2701. set Value = '4'
  2702. where
  2703. SectionName = 'Server_Default-Action'
  2704. and SettingName = 'uAction'
  2705. and PolicySettings.parentid in 
  2706.     (select b.parentid
  2707.     from #VirusScanPolicyIDs, PolicySettings b
  2708.     where
  2709.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2710.     and b.SectionName = 'Server_Default-Action'
  2711.     and b.SettingName = 'uAction'
  2712.     and b.Value = '3'
  2713.     )
  2714.  
  2715. /* ----------------------------------------------------------------------------
  2716. [Wrkstn_Default-Action]                                            [Wrkstn_Default-Action]
  2717. uAction                                        = 3    (Move)        =>  = 4 (Delete)
  2718. uSecAction                                                    =>  = 7 (Deny)
  2719. ---------------------------------------------------------------------------- */
  2720. update PolicySettings
  2721. set Value = '7'
  2722. where
  2723. SectionName = 'Wrkstn_Default-Action'
  2724. and SettingName = 'uSecAction'
  2725. and PolicySettings.parentid in 
  2726.     (select b.parentid
  2727.     from #VirusScanPolicyIDs, PolicySettings b
  2728.     where
  2729.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2730.     and b.SectionName = 'Wrkstn_Default-Action'
  2731.     and b.SettingName = 'uAction'
  2732.     and b.Value = '3'
  2733.     )
  2734.  
  2735. update PolicySettings
  2736. set Value = '4'
  2737. where
  2738. SectionName = 'Wrkstn_Default-Action'
  2739. and SettingName = 'uAction'
  2740. and PolicySettings.parentid in 
  2741.     (select b.parentid
  2742.     from #VirusScanPolicyIDs, PolicySettings b
  2743.     where
  2744.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2745.     and b.SectionName = 'Wrkstn_Default-Action'
  2746.     and b.SettingName = 'uAction'
  2747.     and b.Value = '3'
  2748.     )
  2749.  
  2750. /* ----------------------------------------------------------------------------
  2751. [Server_Default-Action]                                            [Server_Default-Action]
  2752. uAction                                        = 5    (Clean)
  2753. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  2754. ---------------------------------------------------------------------------- */
  2755. update PolicySettings
  2756. set Value = '4'
  2757. where
  2758. SectionName = 'Server_Default-Action'
  2759. and SettingName = 'uSecAction'
  2760. and PolicySettings.parentid in 
  2761.     (select b.parentid
  2762.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2763.     where
  2764.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2765.     and b.SectionName = 'Server_Default-Action'
  2766.     and b.SettingName = 'uAction'
  2767.     and b.Value = '5'
  2768.     and b.ParentID = c.ParentID
  2769.     and c.SectionName = 'Server_Default-Action'
  2770.     and c.SettingName = 'uSecAction'
  2771.     and c.Value = '3'
  2772.     )
  2773.  
  2774. /* ----------------------------------------------------------------------------
  2775. [Wrkstn_Default-Action]                                            [Wrkstn_Default-Action]
  2776. uAction                                        = 5    (Clean)
  2777. uSecAction                                    = 3    (Move)        =>  = 4 (Delete)
  2778. ---------------------------------------------------------------------------- */
  2779. update PolicySettings
  2780. set Value = '4'
  2781. where
  2782. SectionName = 'Wrkstn_Default-Action'
  2783. and SettingName = 'uSecAction'
  2784. and PolicySettings.parentid in 
  2785.     (select b.parentid
  2786.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2787.     where
  2788.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2789.     and b.SectionName = 'Wrkstn_Default-Action'
  2790.     and b.SettingName = 'uAction'
  2791.     and b.Value = '5'
  2792.     and b.ParentID = c.ParentID
  2793.     and c.SectionName = 'Wrkstn_Default-Action'
  2794.     and c.SettingName = 'uSecAction'
  2795.     and c.Value = '3'
  2796.     )
  2797.  
  2798. /* ----------------------------------------------------------------------------
  2799. [Server_Default-Action]                                            [Server_Default-Action]
  2800. uAction                                        = 4    (Delete)
  2801. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  2802. ---------------------------------------------------------------------------- */
  2803. update PolicySettings
  2804. set Value = '7'
  2805. where
  2806. SectionName = 'Server_Default-Action'
  2807. and SettingName = 'uSecAction'
  2808. and PolicySettings.parentid in 
  2809.     (select b.parentid
  2810.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2811.     where
  2812.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2813.     and b.SectionName = 'Server_Default-Action'
  2814.     and b.SettingName = 'uAction'
  2815.     and b.Value = '4'
  2816.     and b.ParentID = c.ParentID
  2817.     and c.SectionName = 'Server_Default-Action'
  2818.     and c.SettingName = 'uSecAction'
  2819.     and c.Value = '3'
  2820.     )
  2821.  
  2822. /* ----------------------------------------------------------------------------
  2823. [Wrkstn_Default-Action]                                            [Wrkstn_Default-Action]
  2824. uAction                                        = 4    (Delete)
  2825. uSecAction                                    = 3    (Move)        =>  = 7 (Deny)
  2826. ---------------------------------------------------------------------------- */
  2827. update PolicySettings
  2828. set Value = '7'
  2829. where
  2830. SectionName = 'Wrkstn_Default-Action'
  2831. and SettingName = 'uSecAction'
  2832. and PolicySettings.parentid in 
  2833.     (select b.parentid
  2834.     from #VirusScanPolicyIDs, PolicySettings b, PolicySettings c
  2835.     where
  2836.     b.ParentID = #VirusScanPolicyIDs.AutoID3
  2837.     and b.SectionName = 'Wrkstn_Default-Action'
  2838.     and b.SettingName = 'uAction'
  2839.     and b.Value = '4'
  2840.     and b.ParentID = c.ParentID
  2841.     and c.SectionName = 'Wrkstn_Default-Action'
  2842.     and c.SettingName = 'uSecAction'
  2843.     and c.Value = '3'
  2844.     )
  2845.  
  2846. /* ----------------------------------------------------------------------------
  2847. [Server_General]                                                [Server_QuarantinePolicy]
  2848. szMoveToFolder=\quarantine                                    =>    szQuarantineDirectory=<SYSTEM_DRIVE>\quarantine
  2849.  ~OR~
  2850. szMoveToFolder=C:\quarantine                                =>    szQuarantineDirectory=C:\quarantine
  2851. ---------------------------------------------------------------------------- */
  2852. insert PolicySettings
  2853. (ParentID, SectionName, SettingName, Value)
  2854. select #VirusScanPolicyIDs.AutoID3, 'Server_QuarantinePolicy', 'szQuarantineDirectory', '<SYSTEM_DRIVE>' + b.Value
  2855. from PolicySettings b, #VirusScanPolicyIDs
  2856. where
  2857. b.ParentID = #VirusScanPolicyIDs.AutoID2
  2858. and b.SectionName = 'Server_General'
  2859. and b.SettingName = 'szMoveToFolder'
  2860. and b.Value like '\%'
  2861.  
  2862. insert PolicySettings
  2863. (ParentID, SectionName, SettingName, Value)
  2864. select #VirusScanPolicyIDs.AutoID3, 'Server_QuarantinePolicy', 'szQuarantineDirectory', b.Value
  2865. from PolicySettings b, #VirusScanPolicyIDs
  2866. where
  2867. b.ParentID = #VirusScanPolicyIDs.AutoID2
  2868. and b.SectionName = 'Server_General'
  2869. and b.SettingName = 'szMoveToFolder'
  2870. and b.Value not like '\%'
  2871.  
  2872. delete PolicySettings 
  2873. where 
  2874. PolicySettings.SectionName = 'Server_General'
  2875. and PolicySettings.SettingName = 'szMoveToFolder'
  2876. and PolicySettings.ParentID in 
  2877. (select 
  2878. AutoID 
  2879. from Policy, PolicySettings
  2880. where 
  2881. Policy.autoid = PolicySettings.parentid
  2882. and Policy.ProductCode = 'VIRUSCAN8700'
  2883. and Policy.ParentType in (6, 5, 4, 3, 1)
  2884. )
  2885.  
  2886. /* ----------------------------------------------------------------------------
  2887. [Wrkstn_General]                                                [Wrkstn_QuarantinePolicy]
  2888. szMoveToFolder=\quarantine                                    =>    szQuarantineDirectory=<SYSTEM_DRIVE>\quarantine
  2889.  ~OR~
  2890. szMoveToFolder=C:\quarantine                                =>    szQuarantineDirectory=C:\quarantine
  2891. ---------------------------------------------------------------------------- */
  2892. insert PolicySettings
  2893. (ParentID, SectionName, SettingName, Value)
  2894. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_QuarantinePolicy', 'szQuarantineDirectory', '<SYSTEM_DRIVE>' + b.Value
  2895. from PolicySettings b, #VirusScanPolicyIDs
  2896. where
  2897. b.ParentID = #VirusScanPolicyIDs.AutoID2
  2898. and b.SectionName = 'Wrkstn_General'
  2899. and b.SettingName = 'szMoveToFolder'
  2900. and b.Value like '\%'
  2901.  
  2902. insert PolicySettings
  2903. (ParentID, SectionName, SettingName, Value)
  2904. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_QuarantinePolicy', 'szQuarantineDirectory', b.Value
  2905. from PolicySettings b, #VirusScanPolicyIDs
  2906. where
  2907. b.ParentID = #VirusScanPolicyIDs.AutoID2
  2908. and b.SectionName = 'Wrkstn_General'
  2909. and b.SettingName = 'szMoveToFolder'
  2910. and b.Value not like '\%'
  2911.  
  2912. delete PolicySettings 
  2913. where 
  2914. PolicySettings.SectionName = 'Wrkstn_General'
  2915. and PolicySettings.SettingName = 'szMoveToFolder'
  2916. and PolicySettings.ParentID in 
  2917. (select 
  2918. AutoID 
  2919. from Policy, PolicySettings
  2920. where 
  2921. Policy.autoid = PolicySettings.parentid
  2922. and Policy.ProductCode = 'VIRUSCAN8700'
  2923. and Policy.ParentType in (6, 5, 4, 3, 1)
  2924. )
  2925.  
  2926. /* ----------------------------------------------------------------------------
  2927. [Server_Alerting]                                                        
  2928. -bMoveFiles
  2929. ---------------------------------------------------------------------------- */
  2930. delete PolicySettings 
  2931. where 
  2932. PolicySettings.SectionName = 'Server_Alerting'
  2933. and PolicySettings.SettingName = 'bMoveFiles'
  2934. and PolicySettings.ParentID in 
  2935. (select 
  2936. AutoID 
  2937. from Policy, PolicySettings
  2938. where 
  2939. Policy.autoid = PolicySettings.parentid
  2940. and Policy.ProductCode = 'VIRUSCAN8700'
  2941. and Policy.ParentType in (6, 5, 4, 3, 1)
  2942. )
  2943.  
  2944. /* ----------------------------------------------------------------------------
  2945. [Wrkstn_Alerting]                                                        
  2946. -bMoveFiles
  2947. ---------------------------------------------------------------------------- */
  2948. delete PolicySettings 
  2949. where 
  2950. PolicySettings.SectionName = 'Wrkstn_Alerting'
  2951. and PolicySettings.SettingName = 'bMoveFiles'
  2952. and PolicySettings.ParentID in 
  2953. (select 
  2954. AutoID 
  2955. from Policy, PolicySettings
  2956. where 
  2957. Policy.autoid = PolicySettings.parentid
  2958. and Policy.ProductCode = 'VIRUSCAN8700'
  2959. and Policy.ParentType in (6, 5, 4, 3, 1)
  2960. )
  2961.  
  2962. /* ----------------------------------------------------------------------------
  2963. [Server_Reporting]                                                        
  2964. -bLogUserName
  2965. ---------------------------------------------------------------------------- */
  2966. delete PolicySettings 
  2967. where 
  2968. PolicySettings.SectionName = 'Server_Reporting'
  2969. and PolicySettings.SettingName = 'bLogUserName'
  2970. and PolicySettings.ParentID in 
  2971. (select 
  2972. AutoID 
  2973. from Policy, PolicySettings
  2974. where 
  2975. Policy.autoid = PolicySettings.parentid
  2976. and Policy.ProductCode = 'VIRUSCAN8700'
  2977. and Policy.ParentType in (6, 5, 4, 3, 1)
  2978. )
  2979.  
  2980. /* ----------------------------------------------------------------------------
  2981. [Wrkstn_Reporting]                                                        
  2982. -bLogUserName
  2983. ---------------------------------------------------------------------------- */
  2984. delete PolicySettings 
  2985. where 
  2986. PolicySettings.SectionName = 'Wrkstn_Reporting'
  2987. and PolicySettings.SettingName = 'bLogUserName'
  2988. and PolicySettings.ParentID in 
  2989. (select 
  2990. AutoID 
  2991. from Policy, PolicySettings
  2992. where 
  2993. Policy.autoid = PolicySettings.parentid
  2994. and Policy.ProductCode = 'VIRUSCAN8700'
  2995. and Policy.ParentType in (6, 5, 4, 3, 1)
  2996. )
  2997. end 
  2998. go
  2999.  
  3000. /* ----------------------------------------------------------------------------
  3001. [Server_UIPOptions]
  3002. UseUTF8=0
  3003. ---------------------------------------------------------------------------- */
  3004. insert PolicySettings
  3005. (ParentID, SectionName, SettingName, Value)
  3006. select #VirusScanPolicyIDs.AutoID3, 'Server_UIPOptions', 'UseUTF8', '0'
  3007. from PolicySettings b, #VirusScanPolicyIDs
  3008. where
  3009. b.ParentID = #VirusScanPolicyIDs.AutoID2
  3010. and b.SectionName = 'Server_UIPOptions'
  3011.  
  3012. /* ----------------------------------------------------------------------------
  3013. [Wrkstn_UIPOptions]
  3014. UseUTF8=0
  3015. ---------------------------------------------------------------------------- */
  3016. insert PolicySettings
  3017. (ParentID, SectionName, SettingName, Value)
  3018. select #VirusScanPolicyIDs.AutoID3, 'Wrkstn_UIPOptions', 'UseUTF8', '0'
  3019. from PolicySettings b, #VirusScanPolicyIDs
  3020. where
  3021. b.ParentID = #VirusScanPolicyIDs.AutoID2
  3022. and b.SectionName = 'Wrkstn_UIPOptions'
  3023.  
  3024. /* ----------------------------------------------------------------------------
  3025. Done...
  3026. ---------------------------------------------------------------------------- */
  3027.  
  3028. if exists (select * from tempdb..sysobjects where name like '#VirusScanPolicyIDs%')
  3029. drop table #VirusScanPolicyIDs
  3030. go
  3031.