Hello Readers, hope you’re well.

Really quick post today on a brand new feature that landed today in the Teams Admin Centre (TAC). Device State Alerting.

If you open the TAC and scroll down to the bottom, you’ll see Notifications & Alerts. Expand that and you will see Rules

There is one Device State Rule already in there. As of now you can’t create new rules. So just open this one

At first it’s empty and now you need to configure it. First thing to do is add room accounts (or any account logged into a device such as a phone, Teams Display, Teams Panel or Microsoft Teams Room.

Click add

Then enter some account names

Then choose a team and channel where you want your alerts to go

Then set the status to active

Now you have a rule

Now all you need to do is wait for a device to go offline. Or you can just unplug one and see what happens. Right now you just get an adaptive card posted to the channel you chose during setup.

Fortunately, I have some alerts I can show you

You can also configure an outgoing webhook. You have to create a JSON payload which looks like this

{ 
    "type": "object",
    "properties": { 
      "AlertTitle": { "type": "string "} ,
      "DeviceLoggedInUserId": { "type": "string" } ,
      "DeviceId": { "type": "string" } , 
      "MetricValues": { 
            "type": "object",
            "properties": { 
                 "DeviceHealthStatus": { "type": "string"} 
            } 
       } ,
       "RuleName": { "type": "string"} ,
       "RuleDescription": { "type": "string"} ,
       "RuleFrequency": { "type": "string"} ,
       "RuleType": { "type": "string"} ,
       "TenantId": { "type": "string"} , 
       "RuleCondition": { "type": "string"} , 
       "AlertRaisedAt": { "type": "string"} 
    } 
} 

Here’s a Sample JSON payload

    { 
      "AlertTitle":"Device_name of User_Name has become offline",
      "DeviceLoggedInUserId": User_GUID ,
      "DeviceId": Device_GUID , 
      "MetricValues": { 
         DeviceHealthStatus": "offline" 
            }, 
        
       "RuleName": "Device state rule" ,
       "RuleDescription": ":"Alerts when device health status is detected as offline" ,
       "RuleFrequency": "Real-time" ,
       "RuleType": "Device Management" ,
       "TenantId": Tenant_GUID , 
       "RuleCondition": "DeviceHealthStatus = Offline" , 
       "AlertRaisedAt": "2020-02-28T12:49:06Z" 
    } 

I haven’t configured Webhook myself. But that’s what’s in the documentation here – Microsoft Teams Devices Monitoring and Alerting – Microsoft Teams | Microsoft Docs

Thoughts

My initial thought is that it’s an okay start. The fact that you can’t create new device state rule or refine what you want to alert from other than offline is one obvious thing they should add.

Adding new device state alerts would be necessary when you want to create an alert for a specific set of rooms sending an alert to a specific channel. As in a different channel to the first alert. Or maybe another webhook to alert another entity for these rooms vs the other rooms. There’s no point alerting the team in the UK about rooms in the US being offline.

Also being about to change from real time alerts (as in it sends immediately when the device goes offline) and add a delay or an exception. For instance, you don’t want to be alerted when the MTR reboots every night from the scheduled task. So adding in a delay of say 10-15 minutes could remove false positives like that.

It would also be great to be able to add more conditions than just offline. Especially when there are peripherals involved. Camera unplugged, screen unplugged, Teams and Exchange sign in failure would be amazing. And I’m sure there are others. I’d even like to receive one when the firmware is out of date so I know to go and device whether I want to update it. Although this is more for Teams phones, panels and displays and Microsoft Teams Rooms on Android.

And I’d love it if the adaptive card had a link that took you to the device object in the TAC.

Lastly, I can see some that might want an email as an alert method in addition to adaptive card and webhook. Useful for notifying an external service desk.

Point is, its a good start, but there’s a lot of room for improvement.

Leave a comment if you have any thoughts on it

That’s all folks. Thanks for reading.