Close Menu
Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Facebook X (Twitter) Instagram
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    • Home
    • Intune
    • Windows
      • Modern Workplace
    • macOS
    • Android
    • iOS
    • Automation
      • Logic Apps
      • Intune Monitoring
      • GitHub
    • Security
      • Passwordless
      • Security
    • Speaking
    • About me
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Home»Automation»MEM Monitoring: Get your Windows Autopilot deployment events in a Teams channel with Logic Apps – Part 2
    Automation

    MEM Monitoring: Get your Windows Autopilot deployment events in a Teams channel with Logic Apps – Part 2

    Peter KlapwijkBy Peter KlapwijkMay 11, 2021Updated:February 14, 202565 Mins Read

    A couple of weeks ago I wrote this article to describe how it is possible to get your Windows Autopilot deployments events in a Teams channel with Logic Apps. I described the basic actions which are needed to post the events in a Teams channel on a recurring schedule.

    After reviewing the messages in Teams, I missed some information about the devices which I couldn’t grab directly from the deployment events themselves; manufacturer and device model. And besides that, I got some questions about how to post the Group TAG in the messages. Information that is also missing from the events.

    This information can be easily requested by using an extra HTTP action, to query MS Graph for the Windows Autopilot Device Identities.

    And when we do have the Group TAG, we could use this to split up the messages and deliver the messages to the Teams channel of the local IT department instead of our own Teams channel (or we deliver them to both). This possibility of course depends on how the Group TAGs are used in our environment. In my example, I can split up the message from the Dutch and Belgium devices, as I use a country code in the group TAGs. You might think of a filter mechanism yourself, based on another value we get from one of the Graph queries.

    This blog post is part of the MEM (Intune) Monitoring series. An article with a short explanation of every MEM Monitoring flow I shared and links to the related articles can be found here.

    Let’s see how we can expand the Logic App, which we created in the previous article.

    Add an extra HTTP GET action to the flow

    If you followed part 1 of this post, you probably have created a Logic App like below.

    The HTTP GET action provides us in the response body the serial number. With that serial number, we are able to query with a second HTTP GET query for the Windows Autopilot Device Identities. The response of that query contains manufacturer, device model, and Group TAG.

    This is the query which we will use in a new HTTP action.

    https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeviceIdentities?$filter=((contains(serialnumber,'[SERIALNR]')))

    This is the response when using the query in Graph Explorer.

    Time to add the extra action.

    Sign-in to the Azure portal and open the previously created Logic App.

    Add the new HTTP action before the HTTP Post action.

    As Method select GET.
    As URI enter:

    https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeviceIdentities?$filter=((contains(serialnumber,'[SERIALNR]')))

    Replace [SERIALNR] with deviceSerialNumber, which you can find as Dynamic content from the first HTTP GET Action.

    Check Authentication and choose Active Directory OAuth as Authentication type. Enter the Tenant, Client ID (from the app registration) and Audience.
    And make sure to select the Key Vault secret value from the Key Vault action.

    Next we add a Parse JSON action to the flow, to parse the output from the HTTP action so we can use that in the upcoming actions.

    As content add Dynamic content Body from the new HTTP action.
    We can fill the Schema, by using an example payload. This example payload is generated by running this flow or by running the same Graph query as from our HTTP action using Graph Explorer.
    Copy the response in Graph Explorer, click Use sample payload to generate the schema, and paste the response in the text box.

    Open the HTTP POST action to add the Dynamic content from the new HTTP GET action. In below example I added manufacturer, model and Group TAG. As soon as you add the new manufacturer, model or Group TAG in the body, the HTTP POST action will be placed in another For each action.

    This is our flow after we added the new actions.

    Deliver messages to local IT Teams channel

    To split the Teams messages based on the Group TAG and deliver these to the local IT Teams channel, we add a Switch action to our flow which creates several cases.

    After the Parse JSON action, we created in the previous step, we add a Switch action.

    In the On box, we add the Dynamic content groupTag.
    We can create several cases, for every IT department one case. In the Equals to box we enter our Group TAG.

    Under every case, we add a HTTP POST action for the corresponding Teams channel (with there own Incoming webhook URI).

    We can also add a HTTP POST action under Default. When the Group TAG doesn’t match one of the TAGs in the cases, the default cases handles the POST action.

    And this is the complete new Logic App flow.



    If you would like to post the messages to the local IT Teams channel and also post all messages to one central Channel, an extra HTTP POST action can be added to the flow after the switch action.

    The end result

    I get the deployment event, including the manufacturer, device model and Group TAG, posted in the corresponding Teams channel.

    The event with Group TAG ‘BE AADJ’ is posted in the Belgium channel.

    And the one witch the NL TAG in the Dutch channel.

    Thanks for reading! Please reach out to me with any thought and ideas on this solution, so we can further improve the Logic App.

    The complete flow can also be downloaded as an ARM Template from my GitHub repository.

    Autopilot Flow Graph Graph API Intune Intune Monitoring Logic Apps MEM MEMMonitoring Microsoft Endpoint Manager Power Automate PowerApps Windows 10 Windows Autopilot
    Share. Facebook Twitter LinkedIn Email WhatsApp
    Peter Klapwijk
    • Website
    • X (Twitter)
    • LinkedIn

    Peter is a Security (Intune) MVP since 2020 and is working as Modern Workplace Engineer at Wortell in The Netherlands. He has more than 15 years of experience in IT, with a strong focus on Microsoft technologies like Microsoft Intune, Windows, and (low-code) automation.

    Related Posts

    Getting started with Android Enterprise dedicated devices with AAD shared mode

    May 15, 2021

    MEM Monitoring: Get your Windows Autopilot deployment events in a Teams channel with Logic Apps – Part 1

    April 16, 2021

    Export Edge favorites to use in an Intune profile or GPO

    April 9, 2021
    View 6 Comments

    6 Comments

    1. Dave Hall on June 17, 2021 19:28

      Unable to use the query @ https://developer.microsoft.com/en-us/graph/graph-explorer See below:

      URL: https://docs.microsoft.com/en-us/graph/query-parameters

      Try in Graph Explorer

      Support for $filter operators varies across Microsoft Graph APIs. The following logical operators are generally supported:

      equals eq / not equals ne
      less than lt / greater than gt
      less than or equal to le / greater than or equal to ge
      and and / or or
      in in
      Negation not
      lambda operator any any
      lambda operator all all
      Starts with startsWith
      Ends with endsWith
      Note: Support for these operators varies by entity. See the specific entity documentation for details.

      The contains string operator is currently not supported on any Microsoft Graph resources.

      So does application delegate have more options available to it than user delegate ?

      Reply
      • Peter Klapwijk on June 23, 2021 10:49

        Not that I’m aware of Dave.

        Reply
    2. Michaël Van den Steen on June 23, 2021 10:39

      This worked for me, thanks a lot!
      Semi-related: do you add group tags during the Autopilot process or do you use another method?

      Thanks!

      Reply
      • Peter Klapwijk on June 23, 2021 10:54

        We have been discussing this with our vendor (Dell) to add Group TAGs direct on ordering. Based on for which BU the order is placed, which TAG is assigned, but unfortunately, this seems not yet available in EMEA.
        So I build another automation solution based on order confirmation which is received via mail. The automation pulls the mail in the flow, processes the attachment (Excel), do some checks to determine for which BU the order is, and assigns the Group TAG to the serials.
        Hope this is a temporary solution and Dell brings their solution to Dell soon.

        Besides that, local IT is able to change the TAG with this solution:
        https://inthecloud247.com/windows-autopilot-lifecycle-automation-with-logic-apps/

        Reply
        • Michaël Van den Steen on June 24, 2021 08:56

          Thanks alot again! 🙂

          Reply
          • Michaël Van den Steen on June 24, 2021 08:56

            a lot*

            Reply
    Leave A Reply Cancel Reply

    Peter Klapwijk

    Hi! Welcome to my blog post.
    I hope you enjoy reading my articles.

    Hit the About Me button to get in contact with me or leave a comment.

    Awards
    Sponsor
    Latest Posts

    Hide the “Turn on an ad privacy feature” pop-up in Chrome with Microsoft Intune

    April 19, 2025

    How to set Google as default search provider with Microsoft Intune

    April 18, 2025

    Using Windows Autopilot device preparation with Windows 365 Frontline shared cloud PCs

    April 13, 2025

    Using Visual Studio with Microsoft Endpoint Privilege Management, some notes

    April 8, 2025
    follow me
    • Twitter 4.8K
    • LinkedIn 6.1K
    • YouTube
    Tags
    Administrative Templates Android Automation Autopilot Azure Azure AD Browser Conditional Access Edge EMS Exchange Online Feitian FIDO2 Flow Google Chrome Graph Graph API Identity Management Intune Intune Monitoring iOS KIOSK Logic Apps macOS MEM MEMMonitoring Microsoft 365 Microsoft Edge Microsoft Endpoint Manager Modern Workplace Office 365 OneDrive for Business Outlook Passwordless PowerApps Power Automate Security SharePoint Online Teams Windows Windows 10 Windows10 Windows 11 Windows Autopilot Windows Update
    Copy right

    This information is provided “AS IS” with no warranties, confers no rights and is not supported by the authors, or In The Cloud 24-7.

     

    Copyright © 2025 by In The Cloud 24-7/ Peter Klapwijk. All rights reserved, No part of the information on this web site may be reproduced or posted in any form or by any means without the prior written permission of the publisher.

    Shorthand; Don’t pass off my work as yours, it’s not nice.

    Recent Comments
    • Peter Klapwijk on Using Windows Autopilot device preparation with Windows 365 Frontline shared cloud PCs
    • John M on Using Windows Autopilot device preparation with Windows 365 Frontline shared cloud PCs
    • Christoffer Jakobsen on Connect to Azure file shares with Microsoft Entra Private Access
    • Ludo on How to block Bluetooth file transfer with Microsoft Intune
    • RCharles on Automatically configure the time zone (during Autopilot enrollment)
    most popular

    Application installation issues; Download pending

    October 1, 2024

    Restrict which users can logon into a Windows 10 device with Microsoft Intune

    April 11, 2020

    How to change the Windows 11 language with Intune

    November 11, 2022

    Update Microsoft Edge during Windows Autopilot enrollments

    July 9, 2024
    Peter Klapwijk – In The Cloud 24-7
    X (Twitter) LinkedIn YouTube RSS
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.

    Manage Cookie Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
    View preferences
    {title} {title} {title}