Skip to content
SCCM Report Include Membership Collection Rule | ConfigMgr Query

SCCM Report Include Membership Collection Rule | ConfigMgr Query

Written By Ankit Shukla
Last Updated June 28, 2024
Posted In SCCM
SHARE

Let’s find the ConfigMgr Include Membership collection Rule using Custom Report, SQL query, and report builder. We have many other SQL queries and custom reports we shared with the HTMD Forum community.

An Include Membership Rule adds members from another collection to the device collection where the rule is applied. Membership rules cannot be added to default collections. Your target collection must have an ID starting with the site code, not SMS. It is possible to include a default collection, in which case the ID of the included collection can start with SMS.

In my previous post, I discussed how to populate machines in a collection using system descriptions and then including them in different collections for bulk deployment. Sometimes, it is required to determine that an individual collection is part of how many other collections use rules.

Index
Include Membership Collection Rule
SQL Query
Result of SQL Query
SCCM Report Include Membership Collection Rule | ConfigMgr Query – Table 1

Include Membership Collection Rule

In this post, I will share a Configuration Manager SQL query that provides you with the details of the above statement. As you can see below, I have two collections.

Patch My PC
  • HTMD Collection
  • Missing Security Updates Patches
SCCM Report Include Membership Collection Rule | ConfigMgr Query - Fig.2
SCCM Report Include Membership Collection Rule | ConfigMgr Query – Fig.1

The Missing Security Updates Patches collection referenced the HTMD collection using the Include rule. The following SCCM custom report lists the collections that reference one particular collection.

SCCM Report Include Membership Collection Rule | ConfigMgr Query - Fig.2
SCCM Report Include Membership Collection Rule | ConfigMgr Query – Fig.2

SQL Query

This SQL Query will help you use ‘When‘ and ‘then‘ syntax. You must have the appropriate access to launch the SQL management studio.

  • Open the SQL Management Studio.
  • Connect your Database Engine.
  • Right-click on your database CM_XXX and click on ‘New Query.’
  • Copy the following SQL query to find the application deployment report with collection details.
  • Click on the Execute button.
SCCM Report Include Membership Collection Rule | ConfigMgr Query - Fig.3
SCCM Report Include Membership Collection Rule | ConfigMgr Query – Fig.3
SELECT COL.Name AS 'Collection Name'
,CASE (CR.RuleType)
WHEN '3' THEN 'Include'
WHEN '4' THEN 'Exclude'
WHEN '2' THEN 'Query'
WHEN '1' THEN 'Direct'
END AS 'Rule Type'
,CR.ReferencedCollectionID AS 'Referenced Collection ID'
,CR.QueryName AS 'Referenced Collection Name'
FROM v_Collection COL
JOIN Collection_Rules CR ON COL.CollID = CR.CollectionID
WHERE CR.RuleType IN ('3') and QueryName='HTMD Collection'

Result of SQL Query

The above SQL Query provides us with the result to determine whether the collection is part of how many other application collections.

  • In the QueryName, provide the collection name for which you want the result.

In this scenario, I tried to find out if the ‘HTMD Collection‘ collection is part of how many other collections.

NOTE! – You can also use ‘ReferenceCollectionID‘ instead of ‘Queryname‘ and provide the Collection ID.

SCCM Report Include Membership Collection Rule | ConfigMgr Query - Fig.4
SCCM Report Include Membership Collection Rule | ConfigMgr Query – Fig.4
Collection NameRule TypeReferenced Collection IDReferenced Collection Name
Missing Security Updates PatchesIncludeMEM00014HTMD Collection
SCCM Report Include Membership Collection Rule | ConfigMgr Query – Table 2

References

We are on WhatsApp. To get the latest step-by-step guides and news updates, Join our Channel. Click here –HTMD WhatsApp.

Author

Ankit Shukla, an IT professional with over seven years of experience, has worked on SCCM/MECM since 2012. During this time, he has extensively dealt with various aspects of the tool, such as migration, infrastructure designing, OSD, custom SQL reporting, and client-side troubleshooting. Ankit’s blog posts reflect his hands-on experience addressing issues and providing practical solutions. The primary aim of his posts is to cater to the audience, comprised of support team members and SCCM admins in organizations.

Written by

Hi,My Name is Ankit Shukla and I have been working in IT since 2012.For last 7 years I have been working on SCCM/MECM. In these years have worked on different features of this tool including Migration/designing the infrastructure/OSD/Custom SQL Reporting/Client Side troubleshooting and others.With my Blog Posts you will find my experience on the issues which i have faced and solutions for that.The major objective of these posts is to reach out the audience who are working as Support team members as SCCM Admins in their organizations.

Discussion

Join the discussion

Your email address will not be published. Required fields are marked *

Related guides

Intune

Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws

Key Takeaways Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws! In the July 2026 Patch, Microsoft introduced new features designed to improve the overall Windows experience. The update adds enhancements to Windows Update for more flexible update management and introduces Point-in-Time Restore, providing an additional recovery option for […]

AC Anoop C Nair 9 min read
Intune

2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws

Key Takeaways 2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws! The June 2026 Windows 11 Patch Tuesday update brings several improvements to File Explorer. It adds support for additional archive formats, including UU, CPIO, XAR, and NuGet Packages (NUPKG). The update also preserves View and Sort preferences in […]

AC Anoop C Nair 10 min read
Intune

2026 May KB5089549 KB5087420 Windows 11 Patch | 0 Zero Day Vulnerabilities and 120 Flaws

Key Takeaways The Windows 11 May 2026 Patch KB5089549 KB5087420 Update brings important security fixes, performance improvements, and reliability enhancements across the operating system. The update introduces new features such as Xbox Mode for gaming, File Explorer improvements, enhanced input and sharing experiences, better taskbar and Windows Hello reliability, and additional enterprise management capabilities for […]

AC Anoop C Nair 8 min read
SCCM

ConfigMgr 2603 Introduces New Early Update Enrollment Process

Key Takeaways In this post we are discussing the ConfigMgr 2603 Introduces New Early Update Enrollment Process. Microsoft has officially released Configuration Manager version 2603 to the Early Update Ring, giving organizations an opportunity to test upcoming improvements before the global production rollout. The release is targeted at enterprises running ConfigMgr version 2409 or later […]

AC Anoop C Nair 3 min read