Skip to content

Instantly share code, notes, and snippets.

Octavian Cordos DarkAllien

Block or report user

Report or block DarkAllien

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View coll_stats.csv
CollID CollType FilterName UpdatesLast UpdatesOverall SCEP
XXX00019 Workstations Workstations True True True
XXX0001A Servers Servers True True True
XXX00018 Servers SubCollection1 True True True
XXX00015 Servers SubCollection2 True False True
View telegraf.conf2
[[inputs.exec]]
commands = ["powershell C:/Telegraf_Scripts/updates.ps1"]
interval = "40s"
timeout = "25s"
data_format = "influx"
View sql_jobs_updates.sql
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;
View clients.ps1
#Parameters
$SQL_Server = '<your SCCM SQL server>'
$Database ='<your SCCM Database>'
$Server_Collection = '<your server collection ID>'
$Workstation_Collection = '<your workstation collection ID>'
#Clients queries
$sqlCmd = "
DECLARE @date DATETIME;
SELECT @date = DATEADD([hh], -12, GETDATE());
View telegraf.conf
###############################################################################
# INPUTS #
###############################################################################
# Windows Performance Counters plugin.
# These are the recommended method of monitoring system metrics on windows,
# as the regular system plugins (inputs.cpu, inputs.mem, etc.) rely on WMI,
# which utilize more system resources.
#
# See more configuration examples at:
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters
View telegraf.conf1
[[inputs.exec]]
commands = ["powershell C:/Telegraf_Scripts/Clients.ps1"]
interval = "20s"
timeout = "30s"
data_format = "influx"
View AssignementID.sql
SELECT [aa].[AssignmentID]
FROM [v_ApplicationAssignment] [aa]
WHERE [ApplicationName] = @AppInfo
AND [aa].[CollectionID] = @CollID;
View AppInfo.sql
SELECT DISTINCT
[aa].[ApplicationName]
FROM [v_ApplicationAssignment] [aa]
ORDER BY 1;
View CollectionInfo.sql
SELECT DISTINCT
[aa].[CollectionID],
[aa].[CollectionName]
FROM [v_ApplicationAssignment] [aa]
WHERE [aa].[ApplicationName] = @AppInfo
ORDER BY 2;
View AppDetails.sql
DECLARE @PolicyModelID INT;
SELECT @PolicyModelID = [PolicyModelID]
FROM [fn_rbac_DeploymentSummary]([dbo].[fn_LShortNameToLCID](@locale), @UserSIDs)
WHERE [AssignmentID] = @AssignmentID;
SELECT *
INTO [Deployment0]
FROM
(
SELECT [AppState].[MachineName],
You can’t perform that action at this time.