Forum Discussion

Paul MacKinnon's avatar
Paul MacKinnon
Copper Contributor
Dec 15, 2017
Solved

Find DSC status of machines connected via OMS

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.

 

AzureDiagnostics
| where Category == "DscNodeStatus"
| summarize by ResultType

3 Replies

    • Paul MacKinnon's avatar
      Paul MacKinnon
      Copper Contributor

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

       

       
      AzureDiagnostics
      | summarize count() by Category == "DscNodeStatus", ResultType
       
      • Noa Kuperberg's avatar
        Noa Kuperberg
        Icon for Microsoft rankMicrosoft

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

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

         

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