You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Constant.cs
+30-25Lines changed: 30 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ namespace Symantec.CWoC
6
6
{
7
7
classConstant
8
8
{
9
-
publicconststringVERSION="11";
10
-
publicconststringZERODAY_SCHEMA_VERSION="0003";
9
+
publicconststringVERSION="12";
10
+
publicconststringZERODAY_SCHEMA_VERSION="0004";
11
11
12
12
#region SQL STRINGS
13
13
publicconststringPATCH_EXCLUSION_QUERY=@"if exists (select 1 from sys.objects where name = 'patchautomation_excluded') select bulletin from patchautomation_excluded";
AND a.[Agent Name] = 'Altiris Software Update Agent'
259
+
AND (dbo.fnVersionCompare(a.[Product Version], '8.0.1000') >= 0)
260
260
WHERE ret.Guid IS NULL -- exclude the retired machine
261
261
262
-
SELECT cb1.BulletinGuid, COUNT(cb1._ResourceGuid)AS Applicable, SUM(cb1.Installed) AS Installed
262
+
SELECT cb1.BulletinGuid, COUNT(cb1._ResourceGuid)AS Applicable, SUM(cb1.Installed) AS Installed
263
263
INTO #tmpBulletinCnt
264
264
FROM (
265
-
SELECT bul._ResourceGuid AS [BulletinGuid], sua._ResourceGuid, CASE WHEN COUNT(sua.UpdateGuid) = SUM( CASE WHEN sui.UpdateGuid IS NULL THEN 0 ELSE 1 END ) THEN 1 ELSE 0 END AS [Installed]
266
-
FROM vPMWindows_UpdateApplicable sua
267
-
JOIN ResourceAssociation b2u
268
-
ON b2u.ChildResourceGuid = sua.UpdateGuid
269
-
AND b2u.ResourceAssociationTypeGuid = '7EEAB03A-839C-458D-9AF2-55DB6B173293' -- SWB to SWU
270
-
JOIN #tmpBulletinNames bul ON bul._ResourceGuid = b2u.ParentResourceGuid
271
-
JOIN #tempScopedResources res ON res._ResourceGuid = sua._ResourceGuid
272
-
LEFT JOIN vPMWindows_UpdateInstalled sui ON sui.UpdateGuid = sua.UpdateGuid
273
-
AND sui._ResourceGuid = sua._ResourceGuid
274
-
WHERE sua.UpdateGuid NOT IN -- filter out supersede applicable updates
275
-
(
276
-
SELECT DISTINCT ChildResourceGuid
277
-
FROM ResourceAssociation
278
-
WHERE ResourceAssociationTypeGuid = '644A995E-211A-4D94-AA8A-788413B7BE5D'
279
-
)
280
-
GROUP BY bul._ResourceGuid, sua._ResourceGuid
265
+
SELECT bul._ResourceGuid AS [BulletinGuid],
266
+
sua._ResourceGuid,
267
+
CASE WHEN COUNT(sua.SoftwareUpdateGuid) = SUM( CASE WHEN sus.DistributionStatus IS NULL AND sui.SoftwareUpdateGuid IS NOT NULL THEN 1
268
+
WHEN sus.DistributionStatus = 128 THEN 1 -- STATE_INSTALLED
269
+
WHEN sus.DistributionStatus = 256 THEN 1 -- STATE_INSTALLED_SUA
270
+
WHEN sus.DistributionStatus = 131072 THEN 1 -- STATE_INSTALLED_WITH_ERRORS
271
+
-- WHEN sus.DistributionStatus = 8192 THEN 1 -- STATE_SUPERSEDED
272
+
ELSE 0 END )
273
+
THEN 1
274
+
ELSE 0 END AS [Installed]
275
+
FROM Inv_Applicable_Windows_Software_Update sua
276
+
JOIN ResourceAssociation b2u ON b2u.ChildResourceGuid = sua.SoftwareUpdateGuid
277
+
AND b2u.ResourceAssociationTypeGuid = '7EEAB03A-839C-458D-9AF2-55DB6B173293' -- SWB to SWU
278
+
JOIN #tmpBulletinNames bul ON bul._ResourceGuid = b2u.ParentResourceGuid
279
+
JOIN #tempScopedResources res ON res._ResourceGuid = sua._ResourceGuid
280
+
LEFT JOIN Inv_Installed_Windows_Software_Update sui ON sui.SoftwareUpdateGuid = sua.SoftwareUpdateGuid
281
+
AND sui._ResourceGuid = sua._ResourceGuid
282
+
LEFT JOIN Inv_Software_Update_Distribution_Status sus ON sus._ResourceGuid = sua._ResourceGuid and sus.SoftwareUpdateGuid = sua.SoftwareUpdateGuid
283
+
LEFT JOIN ResourceAssociation supersede ON supersede.ChildResourceGuid = sua.SoftwareUpdateGuid and supersede.ResourceAssociationTypeGuid = '644A995E-211A-4D94-AA8A-788413B7BE5D'
284
+
WHERE supersede.ParentResourceGuid IS NULL -- filter out supersede applicable updates
285
+
GROUP BY bul._ResourceGuid, sua._ResourceGuid
281
286
) AS cb1
282
287
GROUP BY cb1.BulletinGuid
283
288
284
-
285
289
SELECT distinct(swb._ResourceGuid) AS [_ResourceGuid],
0 commit comments