This guide demonstrates how to create a SCCM collection by IP or Subnet. You can group all your devices existing in a specific IP subnet or an entire IP address range into a collection and deploy applications or scripts based on requirements.
We all know that collections in Configuration Manager are the best way to group the devices based on specific criteria. For instance, you can create collections to group different versions of Windows 11 and target your apps or scripts.
Note: Before you create a custom device collection based on IP address ranges or subnets, make sure you have Hardware Inventory enabled in the Client Settings. SCCM collects changes to the device’s configuration, like IP addresses. SCCM will also auto-discover change of client IP address in the device collection.

WQL Query based on IP Range
Use the below query to create a device collection based on IP address or IP address range. For example, the below query groups devices into a collection with IP address range 192.168.100.1-192.168.101.254.
select * from
SMS_R_System inner join SMS_G_System_NETWORK_ADAPTER_CONFIGURATION on SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.ResourceId = SMS_R_System.ResourceId where SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress like "192.168.100.%" or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress like "192.168.101.%"
WQL Query based on IP Subnets
Use the below query to create a device collection based on IP subnets. This query groups the devices into a collection with IP subnet 192.168.100.0/24.
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where
SMS_R_System.IPSubnets = "192.168.100.0"
Create a device collection by IP or Subnet in SCCM
Open the Configuration Manager console and navigate to Assets and Compliance > Overview > Device Collections. Right-click on Device Collections and select Create Device Collection. Provide a descriptive name for the collection, e.g. Collection – IP Subnet 192.168.100.1/24. Next, choose the limiting collection, such as All Desktops and Server Clients. Click Next.

In the Membership Rules tab, click Add Rule and select Query Rule. Click Edit Query Statement and select the Criteria tab. Click Show Query Language and paste the below WQL query. The below query groups all the computers with IP address range 192.168.100.1–192.168.100.254.
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NETWORK_ADAPTER_CONFIGURATION on SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress like "192.168.100.%" order by SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier

Click Next on the Summary window, and on the completion window, click Close. Wait for a few minutes while the collection is updated. You should find all the computers grouped into the device collection based on the IP address or IP subnet provided in the query.

Further Reading
Check out some examples of creating collections in Configuration Manager.
- Device collection for IIS Servers
- SCCM Device Collection for DHCP Servers
- SCCM Device Collection for Visual Studio
- Create SCCM Device Collection for Windows 10 devices
- Create SCCM Collection for SQL Server
Still Need Help?
If you need further assistance on the above article or want to discuss other technical issues, check out some of these options.