Skip to content

Instantly share code, notes, and snippets.

@DarkAllien
Last active January 16, 2019 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarkAllien/fb56df9f76affe45364a1729963bf295 to your computer and use it in GitHub Desktop.
Save DarkAllien/fb56df9f76affe45364a1729963bf295 to your computer and use it in GitHub Desktop.
BEGIN
--replace all CM_XXX with your SCCM DB name
DECLARE @UserSIDs VARCHAR(16);
SELECT @UserSIDs = 'disabled';
-- Master/Top servers collection ID with updates deployed as required
DECLARE @CollID VARCHAR(8)= 'XXX00111';
DELETE FROM [grafana].[dbo].[Servers]
WHERE [filter] = 'Servers.Patching.Required.Overall';
DECLARE @AuthListLocalID AS INT;
SELECT @AuthListLocalID = [CI_ID]
FROM [CM_XXX].[dbo].[v_AuthListInfo];
-- Adjust this Software Update Group Name filter to fit your Naming Convention
DECLARE @SUG TABLE([id] INT);
INSERT INTO @SUG
SELECT [CI_ID]
FROM [CM_XXX].[dbo].[v_AuthListInfo]
WHERE([title] LIKE '%serv%req%month%'
AND [title] NOT LIKE '%office%'
AND [title] NOT LIKE '%pilot%'
AND [title] NOT LIKE '%TMP%')
OR [title] LIKE '%baseline';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment