Intune Wave Deployment: Create Smart Device Groups

Intune Wave Deployment: Create Smart Device Groups

How do you distribute configuration profile, apps or other configurations in Intune today? In this blog I want to explain and provide a script how you can easily roll out objects in Intune using waves. Here I will help you to create groups defined by you that will pack a specified percentage of your devices into the groups so that you can perform a slow rollout and thus guarantee the quality. The current script describes how you can create device groups. When you validate these rollout waves, it can also be helpful to get assignments of a device via PowerShell. If you are also interested in how to apply this to user groups or how to create a automation for the assignment, check out my new version of the Intune group assignment script.

Intune device groups for phased configuration deployment

How can I get the script?

You can find the script in my GitHub repository.

What I have to do before running the script?

Before running the script you have to define the tenant Id, the client secret and the app Id from your app registration. How to create an app registration you can find below.

In addition to this you have to define the group names for the different waves and the percentage how many devices should be added to this group. If you want to have more groups you only have to add the following line:

$groups += '{"GroupName" : "NAME_OF_THE_GROUP" : "NUMBER_OF_PERCENTS"}' | ConvertFrom-Json

Currently the script use all devices as scope. It is very important to add filters to get only the required devices. How to filter is explained below. If you are working with Intune app targeting, also keep the Applicability Rule behavior in mind.

How to add filter to the call?

You can find in the script an example filter. But you can filter for more or less all attribute you have within the graph object.
The best way is to create the filter via the graph explorer. For this run a query for https://graph.microsoft.com/beta/devices and add ?$filter= and add your filter condition. More informations can be found the Microsoft documentation.

Example:

?$filter=operatingSystem eq 'Windows'

How can I create an app registration?

  • Search for Microsoft Entra ID
Microsoft Intune wave deployment group configuration diagram
  • Select App registration
Intune device groups for staged configuration deployment
  • Select +New registration
Microsoft Intune wave deployment groups for device configurations
  • Enter a Name and click Register
Intune Wave Deployment: Create Smart Device Groups
  • Click API permissions and +Add a permission
Intune Wave Deployment: Create Smart Device Groups
  • Select Microsoft Graph
Intune Wave Deployment: Create Smart Device Groups
  • Select Application permissions
Intune Wave Deployment: Create Smart Device Groups
  • Search for Group.ReadWrite.All and Device.Read.All
Intune Wave Deployment: Create Smart Device Groups
  • Click Grant admin consent for *** and approve with Yes
Intune Wave Deployment: Create Smart Device Groups
  • Select Certificates & secrets and click +New client secret
Intune Wave Deployment: Create Smart Device Groups
  • Enter a Description and select a Expires time
  • Click Add
Intune Wave Deployment: Create Smart Device Groups
  • Copy and save the Value and the Secret ID
Intune Wave Deployment: Create Smart Device Groups

How does it work and how can I use this groups?

The script will create the groups with the size defined by you.

Intune Wave Deployment: Create Smart Device Groups

You can attach these groups in newly created configuration profiles, apps and all other Intune objects. You can start with the first group to test your configuration on a few devices and attach the next group after one or two days. Finally, you can either append the last group or remove everything else and apply the configuration to all devices. Of course you can also use for the assignment filter

If you want to continue with a related automation scenario, check out how to convert Intune device groups to user groups via Microsoft Graph API.

12 thoughts on “Intune Wave Deployment: Create Smart Device Groups

  1. This is a great post, exactly what I was looking for to create deployments in our enterprise because we are so large. If you can do a write-up for doing the same thing for users that would be great!

  2. it seems it picks only 100 devices, due to limit in API call. Would you be able to add @odata.nextLink, till it reads the last record 🙂

  3. It works perfectly!. Thank you!. Is there anyway that we can scope this script to a existing AAD group, so that it will add devices only from that group?

  4. Great. I did manage to modify the script to get members from existing AAD group. Thanks a lot. Since we have 9k+ devices, the script runs more than an hour and access token expires, in the mid of third group creation. I am just working on that to refresh/reissue the access token.

Comments are closed.