Use Powershell to create device collections in Configuration Manager for the new Microsoft 365 Apps update channels

Introduction

While brewing on another blog post, on how I’m preparing for the changes to update channels for Microsoft 365 Apps (formerly known as Office 365 ProPlus), I figured this post will do its justice as a decent opening post.

You may have collections configured for this already, or maybe you don’t. Either way, they probably need some updating before June 9, 2020, as this is the date where the new update channels will start appearing (with the exception of Monthly Enterprise Channel, which is live as we speak).

Also, I’m going to reference some of these collections in my other and upcoming post, so I might as well get this out there, as an help to get started. 🙂

Powershell

The script is available from my GitHub page here: https://github.com/imabdk/Powershell/blob/master/Create-Microsoft365AppsCollections.ps1

The script requires the Configuration Manager Powershell module, which is available from installing the Configuration Manager console.

The script accepts and requires 2 parameters; siteCode and siteServer:

The script needs to be edited with details about limiting collections. These needs to reflect real collections that exists in your environment:

The script does following in headlines:

  • Connects to your Configuration Manager environment
  • Creates a new device collection folder called: Microsoft 365 Apps
  • Creates 14 new collections:
    • 2 for each of the 6 channels: Pilot and Production
    • As well as a general Pilot and Production collections for updating of Microsoft 365 Apps

Configuration Manager

Below is an illustration of the result once the script has successfully run:

Collection membership rule

Let’s take a closer look on the query used in one of the collections. Below the WQL query used on the Current Channel (Preview) collections:

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_OFFICE365PROPLUSCONFIGURATIONS on SMS_G_System_OFFICE365PROPLUSCONFIGURATIONS.ResourceID = 
SMS_R_System.ResourceId where SMS_G_System_OFFICE365PROPLUSCONFIGURATIONS.GPOChannel = 'CurrentPreview' or SMS_G_System_OFFICE365PROPLUSCONFIGURATIONS.GPOChannel = 
'FirstReleaseCurrent' or SMS_G_System_OFFICE365PROPLUSCONFIGURATIONS.cfgUpdateChannel = 'http://officecdn.microsoft.com/pr/64256afe-f5d9-4f86-8936-8840a6a4f5be'"

What I’m doing throughout all the collections, is to look for both the old channel name (GPOChannel) and the new channel name (GPOChannel), as well as the corresponding CDNBaseURL (cfgUpdateChannel).

In above example, that translates into: FirstReleaseCurrent, CurrentPreview and http://officecdn.microsoft.com/pr/64256afe-f5d9-4f86-8936-8840a6a4f5be

So in order for this to give any members, the channel either needs to be set by GPO (or by editing the updatebranch registry key in HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate) OR by actually running the channel with the associated CDNBaseURL.

NOTE#1: I do the membership rule this way to cater for the transition from old to new names, and to make sure I really find the devices running the specified channel, whether it’s set by GPO, modifying the registry or just by querying the running channel.

NOTE#2: I’m not setting ‘Use incremental updates for this collection’ automatically. This is intended. I will let you do that yourself if desired. 🙂

List of channels and URL identifiers

For good measures and everyone’s reference, below a complete list of the channel names and their corresponding URL identifiers.

Monthly Enterprise Channel
CDNBaseUrl = http://officecdn.microsoft.com/pr/55336b82-a18d-4dd6-b5f6-9e5095c314a6

Current Channel
CDNBaseUrl = http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60

Current Channel (Preview)
CDNBaseUrl = http://officecdn.microsoft.com/pr/64256afe-f5d9-4f86-8936-8840a6a4f5be

Semi-Annual Enterprise Channel
CDNBaseUrl = http://officecdn.microsoft.com/pr/7ffbc6bf-bc32-4f92-8982-f9dd17fd3114

Semi-Annual Enterprise Channel (Preview)
CDNBaseUrl = http://officecdn.microsoft.com/pr/b8f9b850-328d-4355-9145-c59439a0c4cf

Beta Channel
CDNBaseUrl = http://officecdn.microsoft.com/pr/5440fd1f-7ecb-4221-8110-145efaa6372f

Next time?

In my upcoming post I will explain how I’m switching update channels using Configuration Items, as well as the design of my device collections (using the provided script in this post) and how I deploy updates for Microsoft 365 Apps.

ENJOY 🙂

3 thoughts on “Use Powershell to create device collections in Configuration Manager for the new Microsoft 365 Apps update channels”

  1. Nice article! I ran the script, but it didn’t complete successfully. It seems that it detects that the ‘Software Updates – Pilots’ limiting collection is not created. Should I create it and does it need to be query based? If so, what would the query be? I didn’t see in this article any instructions on having to create it before running the script and obviously the script doesn’t create it as well. Again, thanks for putting this together!

    Reply
    • Nevermind! I must not have drank enough coffee yet. I read the article again slower and with a bit more caffeine. 🙂

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.