Last active
April 30, 2019 23:16
-
-
Save timdenholm/3cd3de4c126d0026cbedcb7b0e6e06d6 to your computer and use it in GitHub Desktop.
Get SCCM Maintenance Window Memberships
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
fcm.Name AS 'host', | |
cg.CollectionName AS 'sccm_collection_name', | |
fcm.CollectionID AS 'sccm_collection_id', | |
sw.Name AS 'sccm_mw_name', | |
CASE sw.ServiceWindowType | |
WHEN '1' THEN 'All Deployments' | |
WHEN '4' THEN 'Software Updates' | |
WHEN '5' THEN 'Task Sequences' | |
END AS 'sccm_mw_type', | |
sw.Description AS 'sccm_mw_description', | |
sw.Duration 'sccm_mw_duration' | |
FROM v_ServiceWindow sw | |
JOIN v_FullCollectionMembership fcm ON sw.CollectionID = fcm.CollectionID | |
JOIN v_R_System vrs ON fcm.ResourceID = vrs.ResourceID | |
JOIN Collections_G cg ON cg.SiteID = fcm.CollectionID | |
ORDER BY host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment