With SCCM 2002 that was just released, a small but extremely useful feature is now available in console. It is now possible to view what boundary group a device is connected to!

This offers a new opportunity with collections based on Boundary groups, which could mean physical sites or any other meaningful needs in your environment.

I’ve created a PowerShell script that automatically creates collections based on all the available boundary groups.

SCCM Powershell script collection boundary groups
Important Info

A few important notes on the information available here first :

  • If a device is in more than one boundary group, the value is a comma-separated list of boundary group names.
  • The data updates when the client makes a location request to the site, or at most every 24 hours.
  • If a client is roaming and not a member of a boundary group, the value is blank.
  • Information is only available on Primary sites. It is not visible on the CAS.


  • SCCM must be at least version 2002. See our Step-by-step guide upgrade guide here

SCCM Powershell collection boundary groups

The script can be downloaded on GitHub, since Technet Gallery is retiring soon.

Be sure to rate the submission if you are using it.

Example of the result of the script

SCCM Powershell collection boundary groups

Add region, country, or else as a prefix in your boundary group names for easier sort.

Collection query for boundary groups

Thanks to fellow SystemCenterDudes, Eswar Koneti, for his post about that exact query This isn’t the typical query for collections

WQL Query

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.ResourceId in (select resourceid from SMS_CollectionMemberClientBaselineStatus where SMS_CollectionMemberClientBaselineStatus.boundarygroups like ‘%”<BoundaryGroupName>“%’) and SMS_R_System.Name not in (‘Unknown’) and SMS_R_System.Client = ‘1’

Note that I use a like in the query. I’m doing so in the case of clients in multiple boundary groups. This will help in fixing potential errors in a boundary or boundary group.

SCCM Powershell collection boundary groups

Scripts details

A few parameters can be chosen in the script to fit your environment.

SCCM Powershell collection boundary groups
  • $CollectionPrefix let you decide what, if any, characters should be at the beginning of the collection
    • by default, it is set to BG –
  • $LimitingCollection
    • There is some default limiting collection options that are available, based on my previous script to create Master Collections
    • Simply uncomment the desired limiting collection
  • $Schedule
    • Refresh of the collection is set to once a day by default
  • A new folder is created at the root of all device collections, called Boundary Groups based collection
    • All new collections are moved there by default.

Boundary report

We also offer reports for boundary and boundary groups.

Hope this help!

For more information about this new boundary groups feature, see Microsoft docs

Comments (2)