Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

SOLVED SCCM: Create Collection for Devices in Specific Subnet (e.g. 10.18.0.0/16)

Status
Not open for further replies.
Messages
23
Reaction score
0
Points
1
I want to create a dynamic device collection in SCCM that automatically includes all client devices within a specific IP range (10.18.0.0/16) and that are running Windows 11 24H2 (Build 26100).
What is best way to create that?
 
I want to create a dynamic device collection in SCCM that automatically includes all client devices within a specific IP range (10.18.0.0/16) and that are running Windows 11 24H2 (Build 26100).
What is best way to create that?
What do you have for a query now and what is not working with it?
 
What do you have for a query now and what is not working with it?
I would like to move away from manually adding devices to collections bcs i dont have any query right now. My goal is to automate this process by having MECM automatically include all computers running Windows 24H2 and located in the building identified by a specific IP range.
 
I would like to move away from manually adding devices to collections bcs i dont have any query right now. My goal is to automate this process by having MECM automatically include all computers running Windows 24H2 and located in the building identified by a specific IP range.
Ok so again what have you tried? And what is not working? There are no big tricks to this. Just query for the os version then filter on the subnet.
 
Ok so again what have you tried? And what is not working? There are no big tricks to this. Just query for the os version then filter on the subnet.
I create query rule, but i dont know how to create filter for subnet... What is best way to create filter on the subnet? With boundary group or add it to query rule?
 

Attachments

  • Query rule.png
    Query rule.png
    13.3 KB · Views: 8
I create query rule, but i dont know how to create filter for subnet... What is best way to create filter on the subnet? With boundary group or add it to query rule?
Add the Network inventory to the query, then use a Like for the first 2 octets.
 
Like this? I try like this and got error "The query statement that you entered is not valid. Enter a valid query statement".
Try this query

Code:
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 "10.18.%"
 
Try this query

Code:
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 "10.18.%"
Query does not have specific Windows version... This works for me but i have all Windows versions...
 
Alright, here is the query with Windows 11 24H2 builds included. Modify the IP address range before using it:

Code:
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 inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress like "192.168.%" and SMS_G_System_OPERATING_SYSTEM.BuildNumber = "26100"
 
Alright, here is the query with Windows 11 24H2 builds included. Modify the IP address range before using it:

Code:
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 inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress like "192.168.%" and SMS_G_System_OPERATING_SYSTEM.BuildNumber = "26100"
Thanks a lot, it works perfectly!
 
Status
Not open for further replies.
Back
Top