ConfigMgr, PowerShell and MS Teams: Build Results

Overview 

Are you tired of constantly trekking back and forth to your build bench, waiting to see when your devices will finish imaging? I was too. That's why I developed a script for our support team that captures the build results from our task sequence and automates those notifications, making the process more efficient and less time-consuming. I have been using this approach for some time now, but I figured it's worth sharing for those that are interest, so let's jump into it.

The Details

While you can include various items in your report, my main focus was on Make and Model, OS, OS Version, Serial Number, BIOS Version, Run Time, and Built By. The "Built By" field is customized to our environment and requires additional configuration. If you're interested in this setup, please feel free to reach out. Once I identified the necessary data for reporting, I created the PowerShell script below and added it to the task sequence. This will output the information into a txt file and stored onto a file share.


With the details of the built endpoint, you need a method to deliver that information. My solution was to create a PowerShell script that runs every 15 minutes via a scheduled task and reports on all endpoints built within the last 15 minutes. The script gathers the contents of files within the shared folder and converts them into JSON. From here, you have various options to deliver the build information into Teams. Initially, I used a Connector (WebHook specifically) for this, but since Microsoft announced the deprecation of connectors within Teams, we have since moved the workflow into Microsoft Power Automate. I will cover the details of the flow in another post, providing a detailed breakdown of the process within Power Automate and how that gets published into a Teams channel. A simple way to provide better visibility and awareness to your build teams.


Code Repository

Post a Comment

0 Comments