Forum Discussion

zarchi's avatar
zarchi
Copper Contributor
Jul 22, 2020
Solved

Monitor Only "Automatic" Windows Services

Hi All,   Is there a way to monitor only Windows services which the startup type is "Automatic"? I found the following article to monitor Window services. but it is to monitor all Windows servi...
  • Hizarchi ,

    This is possible. Example query:

    ConfigurationChange
     | where ConfigChangeType =~ 'WindowsServices' and ChangeCategory =~ 'Modified' and SvcChangeType =~ 'State' and SvcState =~ 'Stopped' and SvcStartupType =~ 'Auto'
     | extend AggregatedValue = 1 
     | summarize arg_max(TimeGenerated, *) by _ResourceId, SvcDisplayName, bin(TimeGenerated, 5m) 

    You can read more about the query I am using on my blog post. You need to set the alert on Metric measurement, greater than, threshold value 0, total breaches greater than 0. Period 5 mins, frequency 5 minutes. Aggregate on: select _ResourceId and SvcDisplayName. Usually Aggregate on is not available when you create alerts via portal so it is best to create it via ARM Template as I have shown in my blog post. My Advise is to always scope to specific services names as I have shown in my blog post and not to monitor all Automatic services. There are some automatic services that start and stop on certain periods which will generate a lot of false positives and noise.

Resources