Find DSC status of machines connected via OMS

Paul MacKinnon
New Contributor

I have DSC linked to OMS to retrieve logs of machine status and whatnot. What I'm looking for is the ability to show the DSC compliance status of the machines connected.


So, let's say I have 4 machines (PC1, PC2, PC3 and PC4). I would like to know under a category how many machines are either; Failed, Compliant, Started, Completed, In Progress, Suspended, NotCompliant and Pending (as which has been pulled by the ResultType). Something like:


Failed - 1

Compliant - 2

In Progress - 1


I've got as far as this below, but I'm absolutely useless in trying to figure a way to summarise by ResultType without getting 1,000 of counts, or 1,000 of total results, or nothing at all! Please help, the new syntax doesn't have much online documentation to help newbies like me.


| where Category == "DscNodeStatus"
| summarize by ResultType
3 Replies

Hi Paul,

You're actually very close to the syntax you need, if I got you correctly I think this is it:

| summarize count() by Category, ResultType


You can try it on our playground

Also, you might want to check out our tutorial on aggregations, it's exactly on this topic, might help.


Legend, this was getting me close to what I wanted. I ended up doing:


| summarize count() by Category == "DscNodeStatus", ResultType

Hey Paul,
If what you want is to count by ResultType, only for a specific Category, use this: 

| where Category == "DscNodeStatus" 
| summarize count() by ResultType


The syntax you used counts records per result type in other categories as well.


Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
*Updated 9/3* Syncing in Microsoft Edge Preview Channels
Elliot Kirk in Articles on
217 Replies