<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Wei Out There with System Center &amp; OMS</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/feed.xml</link>
    <description />
    <lastBuildDate>Sat, 21 Apr 2018 10:25:30 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>ACS Reports to Log Analytics Search Queries Mapping Updated with KQL</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/acs-reports-to-log-analytics-search-queries-mapping-updated-with-kql</link>
      <pubDate>Fri, 30 Mar 2018 12:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4535</guid>
      <description><![CDATA[The OpsMgr ACS Reports to Log Analytics Search Queries Mapping table has been updated with new query...]]></description>
      <content:encoded><![CDATA[<p><br>The <a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2016/07/25/mapping-acs-reports-to-oms-search-queries/" target="_blank">OpsMgr ACS Reports to Log Analytics Search Queries Mapping table</a> has been updated with new query language in Log Analytics (KQL). <br><br>For a comparison on how the legacy query for each ACS Report is replaced with a corresponding new query in KQL, please refer to the following table:<br>&nbsp;</p> <table class="MsoNormalTable" style="width: 636pt;border-collapse: collapse;margin-left: -0.15pt" cellspacing="0" cellpadding="0" width="848" border="0"> <tbody> <tr style="height: 36.75pt"> <td style="border-top: windowtext 1pt solid;height: 36.75pt;border-right: windowtext 1pt solid;width: 17pt;background: #ffeb9c;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span></span></p></td> <td style="border-top: windowtext 1pt solid;height: 36.75pt;border-right: windowtext 1pt solid;width: 146pt;background: #ffeb9c;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal"><b><span>OpsMgr Audit Collection Services (ACS)</span></b></p></td> <td style="border-top: windowtext 1pt solid;height: 36.75pt;border-right: windowtext 1pt solid;width: 454pt;background: #ffeb9c;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="605" colspan="2" nowrap> <p class="MsoNormal" style="text-align: center" align="center"><b><span>OMS Log Analytics Search Queries</span></b></p></td> <td style="border-top: windowtext 1pt solid;height: 36.75pt;border-right: windowtext 1pt solid;width: 19pt;background: #ffeb9c;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 35.25pt"> <td style="border-top: medium none;height: 35.25pt;border-right: #3f3f3f 1pt solid;width: 17pt;background: #f2f2f2;border-bottom: #3f3f3f 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: #3f3f3f 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><b><span>&nbsp;</span></b></p></td> <td style="border-top: medium none;height: 35.25pt;border-right: #3f3f3f 1pt solid;width: 146pt;background: #f2f2f2;border-bottom: #3f3f3f 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195" nowrap> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Report Name</span></b></p></td> <td style="border-top: medium none;height: 35.25pt;border-right: #3f3f3f 1pt solid;width: 177pt;background: #f2f2f2;border-bottom: #3f3f3f 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="236" nowrap> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Legacy (For Reference)</span></b></p></td> <td style="border-top: medium none;height: 35.25pt;border-right: #3f3f3f 1pt solid;width: 277pt;background: #f2f2f2;border-bottom: #3f3f3f 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="369" nowrap> <p class="MsoNormal" style="text-align: center" align="center"><b><span>New and Enhanced (KQL)</span></b></p></td> <td style="border-top: medium none;height: 35.25pt;border-right: #3f3f3f 1pt solid;width: 19pt;background: #f2f2f2;border-bottom: #3f3f3f 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><b><span>&nbsp;</span></b></p></td></tr> <tr style="height: 45pt"> <td style="border-top: medium none;height: 45pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 45pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Access Violation: <br>Account Locked</span></b></p></td> <td style="border-top: medium none;height: 45pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=539 OR EventID=644 OR EventID=4740 OR EventID=6279</span></p></td> <td style="border-top: medium none;height: 45pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><span><strong>SecurityEvent <br>| where EventID==539 or EventID==644 or EventID==4740 or EventID==6279</strong></span></p></td> <td style="border-top: medium none;height: 45pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=539 OR EventID=644 OR EventID=4740 OR EventID=6279 | measure count() by EventID</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==539 or EventID==644 or EventID==4740 or EventID==6279<br>| summarize count() by EventID</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 120pt"> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Access Violation: <br>Unsuccessful Logon Attempts<br><br></span></b></p></td> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID:[529..537] OR EventID=539 OR (EventID=4625 AND Status=0xc000006d)<span>&nbsp; </span>| Select TargetAccount, IpAddress, Computer, LogonProcessName, AuthenticationPackageName, LogonTypeName</span></p></td> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID between (529 .. 537) or EventID==539 or (EventID==4625 and Status=="0xc000006d")<span>&nbsp; </span><br>| project TargetAccount, IpAddress, Computer, LogonProcessName, AuthenticationPackageName, LogonTypeName</span></b></p></td> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 105pt"> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID:[529..537] OR EventID=539 OR (EventID=4625 AND Status=0xc000006d) | measure count() by TargetAccount</span></p></td> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID between (529 .. 537) or EventID==539 or (EventID==4625 and Status=="0xc000006d")<span>&nbsp; </span><br>| summarize EventCount=count() by TargetAccount <br>| order by EventCount desc</span></b></p></td> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 135pt"> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span><br><span>&nbsp;</span><br>Account Management: <br>Domain and Built-in Administrators Membership Changes<br><br></span></b></p></td> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=4728 OR EventID=4732 OR EventID=4756 OR EventID=632 OR EventID=636 OR EventID=660 AND (“*512” OR “S-1-5-32-544”) | Extend “Add Member” AS Action | Select Action, TargetUserName, Activity, SubjectAccount, MemberName, TimeGenerated, Computer</span></p></td> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==4728 or EventID==4732 or EventID==4756 or EventID==632 or EventID==636 or EventID==660<br>| search "S-1-5-32-544" or "512"<br>| project Action="Add Member", TargetUserName, Activity, SubjectAccount, MemberName, TimeGenerated, Computer</span></b></p></td> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 135pt"> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=4729 OR EventID=4733 OR EventID=4757 OR EventID=633 OR EventID=637 OR EventID=661 AND (“*512” OR “S-1-5-32-544”) | Extend “Remove Member” AS Action | Select Action, TargetUserName, Activity, SubjectAccount, MemberName, TimeGenerated, Computer</span></p></td> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==4729 or EventID==4733 or EventID==4757 or EventID==633 or EventID==637 or EventID==661<br>| search "S-1-5-32-544" or "512"<br>| project Action="Remove Member", TargetUserName, Activity, SubjectAccount, MemberName, TimeGenerated, Computer</span></b></p></td> <td style="border-top: medium none;height: 135pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 210pt"> <td style="border-top: medium none;height: 210pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 210pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Account Management: <br>Passwords Change Attempts by Non-owner</span></b></p></td> <td style="border-top: medium none;height: 210pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent (EventID=4723 OR EventID=4724 OR EventID:[627..628]) AND SubjectAccount!=”ANONYMOUS LOGON” TargetAccount NOT IN {Type=SecurityEvent (EventID=4723 OR EventID=4724 OR EventID:[627..628]) AND SubjectAccount!=”ANONYMOUS LOGON” | measure count() by SubjectAccount} | EXTEND SubjectAccount AS ChangedBy | Select<span>&nbsp; </span>TimeGenerated, Computer, TargetAccount, ChangedBy</span></p></td> <td style="border-top: medium none;height: 210pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==4723 or EventID==4724 or EventID between (627 .. 628) and SubjectAccount != "ANONYMOUS LOGON" and TargetAccount!=SubjectAccount<br>| project TimeGenerated, Computer, TargetAccount, ChangedBy=SubjectAccount</span></b></p></td> <td style="border-top: medium none;height: 210pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 90pt"> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Account Management: <br>User Accounts Created</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent (EventID=624 OR EventID=4720) | EXTEND SubjectAccount AS CreatedBy | Select TimeGenerated, TargetAccount, CreatedBy, Computer</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==624 or EventID==4720<br>| project TimeGenerated, TargetAccount, CreatedBy=SubjectAccount, Computer</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 90pt"> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Account Management: <br>User Accounts Deleted</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent (EventID=630 OR EventID=4726) | EXTEND SubjectAccount AS DeletedBy | Select TimeGenerated, TargetAccount, DeletedBy, Computer</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==630 or EventID==4726 <br>| project TimeGenerated, TargetAccount, DeletedBy=SubjectAccount, Computer</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Forensic: <br>All Events For Specified Computer</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent Computer=”&lt;&lt;Computer Name&gt;&gt;”</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let computerName = "";<span>&nbsp; </span>//Enter a Computer Name<br>SecurityEvent <br>| where Computer==computerName</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 75pt"> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent Computer=”&lt;&lt;Computer Name&gt;&gt;” | measure count() by Activity</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let computerName = "";<span>&nbsp; </span>//Enter a Computer Name<br>SecurityEvent <br>| where Computer==computerName<br>| summarize count() by Activity</span></b></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span><br><span>&nbsp;</span>Forensic: <br>All Events For Specified User<br><br></span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent Account=”&lt;&lt;User Domain\\Account Name&gt;&gt;”</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let accountName = ""; //Enter a User Domain\\Account Name<br>SecurityEvent<br>| where Account == accountName</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 75pt"> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent Account=”&lt;&lt;User Domain\\Account Name&gt;&gt;” | measure count() by Activity</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let accountName = ""; //Enter a User Domain\\Account Name<br>SecurityEvent<br>| where Account == accountName<br>| summarize count() by Activity</span></b></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="3" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Forensic: <br>All Events With Specified Event ID</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=”&lt;&lt;Event Id&gt;&gt;”</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let eventId = 0; //Replace 0 with another event Id<br>SecurityEvent<br>| where EventID == eventId</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 75pt"> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=”&lt;&lt;Event Id&gt;&gt;” | measure count() by Computer</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let eventId = 0; //Replace 0 with another event Id<br>SecurityEvent<br>| where EventID == eventId<br>| summarize count() by Computer</span></b></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=”&lt;&lt;Event Id&gt;&gt;” | measure count() by Account</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let eventId = 0; //Replace 0 with an eventId<br>SecurityEvent<br>| where EventID == eventId<br>| summarize count() by Account</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Planning: <br>Event Counts</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID!=0 | measure count() AS Count by Activity</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID!=0 <br>| summarize Count=count() by Activity<br>| order by Count</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 90pt"> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Planning: <br>Event Counts by Computer</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent Computer=”&lt;&lt;Computer Name&gt;&gt;” | measure count() by Activity</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let computerName = ""; //Enter a Computer Name<br>SecurityEvent <br>| where Computer==computerName<br>| summarize Count=count() by Activity<br>| order by Count</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 90pt"> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent Computer=”&lt;&lt;Computer Name&gt;&gt;” | measure count() by EventID</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let computerName = ""; //Enter a Computer Name<br>SecurityEvent <br>| where Computer==computerName<br>| summarize Count=count() by EventID<br>| order by Count</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 75pt"> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Planning: <br>Hourly Event Distribution</span></b></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID!=0 | measure count() AS Count by TimeGenerated Interval 1Hour</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID!=0<br>| summarize Count=count() by bin(TimeGenerated,1h)<br>| render timechart</span></b></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 120pt"> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID!=0 AND EventID:[xx..yy] | measure count() AS Count by Activity Interval 1Hour</span></p></td> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>let x=1;<br>let y=10000;<br>SecurityEvent <br>| where EventID between (x .. y) or EventID!=0<br>| summarize Count=count() by Activity, bin(TimeGenerated,1h)<br>| render timechart</span></b></p></td> <td style="border-top: medium none;height: 120pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 90pt"> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" rowspan="2" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Planning: <br>Logon Counts of Privileged Users</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=576 OR EventID=4672 AND SubjectDomainName!=”NT AUTHORITY” AND AccountType!=”Machine” | Select SubjectAccount, PrivilegeList</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==576 or EventID==4672<br>| where SubjectDomainName!="NT AUTHORITY" and AccountType!="Machine"<br>| project SubjectAccount, PrivilegeList</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 90pt"> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=576 OR EventID=4672 AND SubjectDomainName!=”NT AUTHORITY” AND AccountType!=”Machine” | Measure Count() by SubjectAccount</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==576 or EventID==4672<br>| where SubjectDomainName!="NT AUTHORITY" and AccountType!="Machine"<br>| summarize count() by SubjectAccount <br>| order by count_</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Policy: <br>Account Policy Changed</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=643 OR EventID=4739 | Select Computer, Activity, TimeGenerated, EventData</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==643 or EventID==4739<br>| project Computer, Activity, TimeGenerated, EventData</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Policy: <br>Audit Policy Changed</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=612 OR EventID=4719 | Select Computer, Activity, TimeGenerated, EventData</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==612 or EventID==4719 <br>| project Computer, Activity, TimeGenerated, EventData</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Policy: <br>Object Permissions Changed</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=4670 | Select TimeGenerated, Activity, Computer, EventData</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==4670 <br>| project TimeGenerated, Activity, Computer, EventData</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 90pt"> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Policy: <br>Privilege Added Or Removed</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID:[608..609] OR EventID:[621..622] OR EventID:[4704..4705] | Select TimeGenerated, Activity, Computer, EventData</span></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID between (608 .. 609) or EventID between (621 .. 622) or EventID between (4704 .. 4705)<br>| project TimeGenerated, Activity, Computer, EventData</span></b></p></td> <td style="border-top: medium none;height: 90pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 48pt"> <td style="border-top: medium none;height: 48pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 48pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>System Integrity: <br>Audit Failure</span></b></p></td> <td style="border-top: medium none;height: 48pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=516 OR EventID=4612 | Select TimeGenerated, Activity, Computer</span></p></td> <td style="border-top: medium none;height: 48pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==516 or EventID==4612<br>| project TimeGenerated, Activity, Computer</span></b></p></td> <td style="border-top: medium none;height: 48pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>System Integrity: <br>Audit Log Cleared</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=517 OR EventID=1102 | Select Activity, Computer, TimeGenerated, EventData</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==517 or EventID==1102<br>| project Activity, Computer, TimeGenerated, EventData</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 75pt"> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span><br><span>&nbsp;</span><br>Usage: <br>Object Access<br><br></span></b></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=560 OR EventID=567 OR EventID=4656 OR EventID=4663 | Select Computer, Activity, TimeGenerated, EventData</span></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==560 or EventID==567 or EventID==4656 or EventID==4663 <br>| project Computer, Activity, TimeGenerated, EventData</span></b></p></td> <td style="border-top: medium none;height: 75pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Usage: <br>Privileged logon</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=576 OR EventID=4672 | Select TimeGenerated, Activity, Computer, SubjectAccount, PrivilegeList</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==576 or EventID==4672<br>| project TimeGenerated, Activity, Computer, SubjectAccount, PrivilegeList</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 150pt"> <td style="border-top: medium none;height: 150pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 150pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Usage: <br>Sensitive Security Groups Changes</span></b></p></td> <td style="border-top: medium none;height: 150pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID:[4727..4735] OR EventID=4737 OR EventID:[4754..4758] OR EventID:[631..639] OR EventID=641 OR EventID:[658..662] | EXTEND TargetUserName As GroupName | Select Activity, GroupName, SubjectAccount, MemberName, TimeGenerated</span></p></td> <td style="border-top: medium none;height: 150pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID between (4727 .. 4735) or EventID==4737 or EventID between (4754 .. 4758) or EventID between (631 .. 639) or EventID==641 or EventID between (658 .. 662) <br>| project Activity, GroupName=TargetUserName, SubjectAccount, MemberName, TimeGenerated<br>| order by Activity desc</span></b></p></td> <td style="border-top: medium none;height: 150pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 105pt"> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>Usage: <br>User Logon</span></b></p></td> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=528 OR EventID=540 OR EventID=4624 | Select TimeGenerated, Activity, Computer, IpAddress, AuthenticationPackageName, LogonProcessName, LogonTypeName, TargetAccount</span></p></td> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==528 or EventID==540 or EventID==4624<br>| project TimeGenerated, Activity, Computer, IpAddress, AuthenticationPackageName, LogonProcessName, LogonTypeName, TargetAccount</span></b></p></td> <td style="border-top: medium none;height: 105pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>DAC: <br>File Resource Property Changes</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=4911 | Select Computer, Activity, TimeGenerated, SubjectAccount, EventData</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==4911 <br>| project Computer, Activity, TimeGenerated, SubjectAccount, EventData</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>DAC: <br>Central Access Policy For File Changes</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=4913 | Select Computer, Activity, TimeGenerated, SubjectAccount, EventData</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==4913<br>| project Computer, Activity, TimeGenerated, SubjectAccount, EventData</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr> <tr style="height: 60pt"> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 17pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: windowtext 1pt solid;padding-right: 5.4pt" valign="bottom" width="23" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 146pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" width="195"> <p class="MsoNormal" style="text-align: center" align="center"><b><span>DAC: <br>Object Attribute Changes</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 177pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="236"> <p class="MsoNormal"><span>Type=SecurityEvent EventID=5136 OR EventID=5137 | Select Computer, Activity, TimeGenerated, SubjectAccount, EventData</span></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 277pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="top" width="369"> <p class="MsoNormal"><b><span>SecurityEvent <br>| where EventID==5136 or EventID==5137 <br>| project Computer, Activity, TimeGenerated, SubjectAccount, EventData</span></b></p></td> <td style="border-top: medium none;height: 60pt;border-right: windowtext 1pt solid;width: 19pt;border-bottom: windowtext 1pt solid;padding-bottom: 0cm;padding-top: 0cm;padding-left: 5.4pt;border-left: medium none;padding-right: 5.4pt" valign="bottom" width="25" nowrap> <p class="MsoNormal"><span>&nbsp;</span></p></td></tr></tbody></table> <p><br><br>&nbsp; </p> <p><strong>Additional Resources:</strong></p> <p>The Azure Log Analytics Query Language Reference can be used to search for examples and further information on query operators and functions:<br><a href="https://docs.loganalytics.io/docs/Language-Reference" target="_blank">https://docs.loganalytics.io/docs/Language-Reference</a><font color="#333333"><br><br></font>Log Analytics Demo Portal: <br><a href="https://portal.loganalytics.io/demo" target="_blank">https://portal.loganalytics.io/demo</a><br> <p><em><font size="3" face="Arial">&nbsp; </font></em></p> <p><em><font size="3" face="Arial"><br></font></em><font size="3" face="Arial"></font>&nbsp;</p> <h5></h5> <h6>Disclaimer: </h6> <h6>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.</h6>]]></content:encoded>
    </item>
    <item>
      <title>Log Analytics: Displaying a Value for Calculated Percentage (%) on a Custom Number Tile or View</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/log-analytics-displaying-a-value-for-calculated-percentage-on-a-custom-number-tile-or-view</link>
      <pubDate>Sun, 18 Feb 2018 10:18:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4585</guid>
      <description><![CDATA[The View Designer allows you to create a variety of custom tiles and views in the Azure Portal in...]]></description>
      <content:encoded><![CDATA[<p><font size="3">The <a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-view-designer" target="_blank">View Designer</a> allows you to create a variety of custom tiles and views in the Azure Portal in your Log Analytics workspace. There are 4 types of tiles and visualization parts (views) that can be created with the View Designer to display text values that represent the counts of records from log analytics queries, lets call them <strong>Number Tiles or Views</strong>.<strong> </strong>They consist of:</font></p><font size="3"> <ul> <li><strong><a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-view-designer-tiles#number-tile" target="_blank">Single Number Tile</a>:</strong> The count of records from a query. <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image228.png" width="88" height="67">  <li><strong><a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-view-designer-tiles#two-numbers-tile" target="_blank">Two Numbers Tile</a>:</strong> The counts of records from two different queries.&nbsp; <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image229.png" width="66" height="79">&nbsp; <li><strong><a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-view-designer-parts#number-and-list-part" target="_blank">Single Number and List View</a>:</strong> The header displays a single number that shows a count of records from a log search query. <br>The list displays the top ten results from a query.&nbsp; <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image230.png" width="89" height="141">  <li><strong><a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-view-designer-parts#two-numbers-and-list-part" target="_blank">Two Numbers and List View</a>:</strong>The header displays two numbers that show counts of records from separate log search queries. <br>The list displays the top ten results from a query. <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image231.png" width="88" height="153"> <br></li></ul> <p><br>To allow a Number Tile or View to display a calculated percentage value from a Log Analytics query in KQL, the log query used will need to return the exact number of rows or records to represent the calculated percentage. Here are the steps to tweak a log query to achieve that.<br><br><em><strong>Update April 2018: As an alternative, the </strong><a href="https://docs.loganalytics.io/docs/Language-Reference/Tabular-operators/print-operator" target="_blank"><strong>print</strong></a><strong> tabular operator can also be used to achieve the same result: <br></strong>(Note that the print operator is useful as a quick way to test scalar expression evaluation in the system. Without it, one has to resort to tricks such as prepending the evaluation with a range x from 1 to 1 step 1 | project ...)<br></em></p> <h3>Step 1:</h3> <p><strong>Develop a query that will return a record set with the required columns and values.</strong><br>In this example, a <strong>data table (<em>testTable</em>) </strong>is used to represent a table with two columns of string values. The first column contains the row name, and the second column contains the health state of that row record.</p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:041f7220-ec17-45e8-993e-af36d5b99f3f" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1068px;height: 415px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">let testTable</span><span style="color: #000000">=</span><span style="color: #000000">datatable(projectedVal1: string, projectedResult: string)
[
'Row1','Healthy',
'Row2','Critical',
'Row3','Healthy',
'Row4','Healthy',
'Row5','Warning',
'Row6','Critical',
'Row7','Healthy',
'Row8','Healthy',
'Row9','Healthy',
'Row10','Warning'
];
testTable </span><span style="color: #000000">|</span><span style="color: #000000"> project projectedVal1, projectedResult


</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p>Here is the log query result in the Advanced Analytics Portal:<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image232.png" width="324" height="347">&nbsp;<br><br><strong></strong></p>
<h3>Step 2:</h3><strong>Modify the log query to calculate the required percentage value based on the total number of records.<br></strong>In this example, a original query is modified with two column extensions. The first extended column is assigned a value of “1” if the “<em>projectedResult”</em> column of a record contains a value of “<strong>Healthy</strong>”. The second extended column is assigned with a value of “1” for every record. With these values assigned correctly, the number of records with a “<strong>Healthy</strong>” values and the total number of records in the record set can be calculated by the <strong>summarize </strong>operator. Hence the percentage of “<strong>Healthy</strong>” records in the record set can also be calculated as follows, in this case, the result is 60%.<br>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:84141a11-0c02-4cb8-8194-0ebf32b49e90" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1088px;height: 204px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">testTable 
| extend count1=iff(projectedResult == &quot;Healthy&quot; , 1 , 0) //If Healthy, Return 1, else 0
| extend count2=1 // to be used for total row count
| summarize HealthyCount=sum(count1), TotalRecords=sum(count2)
| extend percentAvailable=(HealthyCount*100)/TotalRecords


</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><br>Here is the log query result in the Advanced Analytics Portal:<br><br>
<p><strong><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image233.png" width="392" height="80"> <br><br><br></strong></p>
<h3>Step 3:</h3>
<p><strong>Create a dummy table with 100 rows and join it with the result returned from the previous step.</strong><br>In this example, a dummy table with 100 rows is created and <strong>right-outer-joined </strong>with the calculated results from Step 2<strong>&nbsp; </strong>to create a new record set with 100 rows. Note that the dummy table has a column “<em>numcount</em>”<em> </em>that represents the row number of the record. Hence, the maximum value of “<em>numcount</em>” in the new record set will be100.</p>
<p></p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:9687c0ae-3fb2-4794-90a9-0ce67b7d9639" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1088px;height: 325px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">range i from 0 to 99 step 1 // create dummy table
| project numcount=i+1, mergecol=&quot;oms&quot; 
| join kind=rightouter (testTable 
| extend count1=iff(projectedResult == &quot;Healthy&quot; , 1 , 0) //If Healthy, Return 1, else 0
| extend count2=1 // to be used for total row count
| summarize HealthyCount=sum(count1), TotalRecords=sum(count2)
| extend percentAvailable=(HealthyCount*100)/TotalRecords
| extend mergecol=&quot;oms&quot; ) on mergecol
| project numcount, HealthyCount, TotalRecords, percentAvailable 


 
</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p></p>
<p>Here is the log query result in the Advanced Analytics Portal:<br><br><strong>&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image234.png" width="708" height="265"> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; …</strong><br><strong></strong></p>
<h3>Step 4:</h3>
<p><strong>Calculate and count the number of records returned<br></strong>In this example, a filter is applied to return only the records with their row number values less than or equal to the value in the “<em>percentAvailable</em>” column, i.e. the percentage of Healthy records in the sample table from Step 1. The total number of resultant records is then calculated for the Number Tile or View.<br></p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:4151983b-2467-473d-bdb0-7dcff6809e36" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1108px;height: 368px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">range i from 0 to 99 step 1 
| project numcount=i+1, mergecol=&quot;oms&quot; 
| join kind=rightouter (testTable 
| extend count1=iff(projectedResult == &quot;Healthy&quot; , 1 , 0) //If Healthy, Return 1, else 0
| extend count2=1 // to be used for total row count
| summarize HealthyCount=sum(count1), TotalRecords=sum(count2)
| extend percentAvailable=(HealthyCount*100)/TotalRecords
| extend mergecol=&quot;oms&quot; ) on mergecol
| project numcount, HealthyCount, TotalRecords, percentAvailable 
| where numcount </span><span style="color: #0000FF">&lt;</span><span style="color: #800000">= percentAvailable
</span><span style="color: #FF0000">| count
 

</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p></p>
<p>Here is the log query result in the Advanced Analytics Portal:<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image235.png" width="177" height="83">&nbsp;<br><br></p>
<h3>Step 5:</h3><strong>Configure the Number Tile or View.<br></strong>
<p><strong></strong>From Step 4, copy and paste the query into the <strong>Query Field </strong>of any Number Tile or View in the View Designer. Here is what it would look like on a Number Tile and a Number View:<br><br>For a <strong>Number Tile</strong>:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image236.png" width="382" height="222"> <br><br>For a <strong>Number View </strong>(using a 31x33 JPG of a “<strong>%</strong>” symbol):<br>&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2018/04/image237.png" width="387" height="287"> <br></p>
<p>Note to remove the comments and reformat the query into a long string as follows to test the full query of the example from Step 1:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:11698337-83eb-43a0-9bf5-3d0c88e988fc" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1128px;height: 246px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">let testTable=datatable(projectedVal1:string, projectedResult:string) ['Row1','Healthy','Row2','Critical','Row3','Healthy','Row4','Healthy','Row5','Warning','Row6','Critical','Row7','Healthy','Row8','Healthy','Row9','Healthy','Row10','Warning'];range i from 0 to 99 step 1 | project numcount=i+1, mergecol=&quot;oms&quot; | join kind=rightouter (testTable | extend count1=iff(projectedResult == &quot;Healthy&quot; , 1 , 0) | extend count2=1 | summarize HealthyCount=sum(count1), TotalRecords=sum(count2) | extend percentAvailable=(HealthyCount*100)/TotalRecords | extend mergecol=&quot;oms&quot; ) on mergecol| project numcount, HealthyCount, TotalRecords, percentAvailable | where numcount </span><span style="color: #0000FF">&lt;</span><span style="color: #800000">= percentAvailable</span><span style="color: #FF0000">| count
 

</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><br>or if without the <strong>datatable</strong> declaration: 
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:9f51d3f6-b8da-4ceb-8b45-9b2134bb2978" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1108px;height: 166px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">range i from 0 to 99 step 1 | project numcount=i+1, mergecol=&quot;oms&quot; | join kind=rightouter (testTable | extend count1=iff(projectedResult == &quot;Healthy&quot; , 1 , 0) | extend count2=1 | summarize HealthyCount=sum(count1), TotalRecords=sum(count2) | extend percentAvailable=(HealthyCount*100)/TotalRecords | extend mergecol=&quot;oms&quot; ) on mergecol| project numcount, HealthyCount, TotalRecords, percentAvailable | where numcount </span><span style="color: #0000FF">&lt;</span><span style="color: #800000">= percentAvailable</span><span style="color: #FF0000">| count</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p>&nbsp;</p>
<p>Alternatively, if the <strong>print </strong>tabular operator is used, the query would look like the following example provided by my colleague Divyadeep Dayal.<br></p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:cac045d3-5b62-4c16-914c-afc06c72d5ff" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1148px;height: 198px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">let tot1=toscalar ( Perf | summarize count() ) ;
let tot2=toscalar ( Perf | where ObjectName == &quot;Processor&quot; | summarize count() ) ;
let perc = tot2*100/tot1;
print perc

</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p></p>
<p>(<em>Note: the <strong>print</strong> operator cannot follow pipe ('|')</em>&nbsp; )<br><br><br><br>&nbsp;</p></font>
<p><strong>Additional Resources:</strong></p>
<p>The Azure Log Analytics Query Language Reference can be used to search for examples and further information on query operators and functions:<br><a href="https://docs.loganalytics.io/docs/Language-Reference" target="_blank">https://docs.loganalytics.io/docs/Language-Reference</a><font color="#333333"><br><br></font>Log Analytics Demo Portal: <br><a href="https://portal.loganalytics.io/demo" target="_blank">https://portal.loganalytics.io/demo</a><br>
<p><em><font size="3" face="Arial">&nbsp; </font></em></p>
<p><em><font size="3" face="Arial"><br></font></em><font size="3" face="Arial"></font>&nbsp;</p>
<h5></h5>
<h6>Disclaimer: </h6>
<h6>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.</h6>]]></content:encoded>
    </item>
    <item>
      <title>OMS Free Tier Solution Based Billing Tracker – Security &amp; Audit</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/oms-free-tier-solution-based-billing-tracker-security-audit</link>
      <pubDate>Mon, 26 Jun 2017 10:28:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4485</guid>
      <description><![CDATA[On June 19, 2017, a new pricing model was introduced to the OMS Security and Compliance management...]]></description>
      <content:encoded><![CDATA[<p>On June 19, 2017, a new pricing model was introduced to the OMS Security and Compliance management offer and it applies to all OMS pricing tiers including the <strong>Free Tier</strong>. Solutions like the <strong>Security &amp; Audit</strong>&nbsp;<strong>Solution</strong> if added anytime <strong>after the above cutoff date</strong> (June 19, 2017), will be free for the first <strong>60 days</strong>. After the 60-day trial for the continuous use of this solution, a per node billing will be applied. This feature is called <strong>Solution Based Billing </strong>as this new billing is based on a specific solution instead of the pricing tier. This change will not affect an OMS Workspace if the Security &amp; Audit Solution was added <strong>before June 19, 2017.</strong><br>For more information, please visit the <a href="https://azure.microsoft.com/en-us/pricing/details/security-compliance/?v=17.23h" target="_blank">Security and Compliance Pricing site</a>.<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image588.png" width="490" height="353">&nbsp;&nbsp; <br><br><br>This post features a custom OMS Dashboard – the <strong>Free Tier Solution Based Billing Tracker - Security &amp; Audit </strong>– that extends the <strong>Log Analytics</strong> <strong>Usage</strong> and <strong>AzureActivity </strong>typed records. (Usage typed records are used primarily to drive the OMS Usage Dashboard and AzureActivity typed records are collected and stored by the OMS <a href="https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-archive-activity-log" target="_blank">Azure Log</a> Analytics Solution. This OMS Dashboard helps detect and list Security &amp; Audit Solution related activities captured in the Azure Activity Log, like Add or Remove, that is happening in a particular workspace after <strong>June 19, 2017</strong>, and verifies whether or not the Solution Based Billing feature has been enabled for the Security &amp; Audit Solution added in that OMS Workspace in the Free Tier. <strong>If the Solution Based Billing feature is enabled, per node billing after 60 days of continuous use of the Security &amp; Audit Solution will apply.</strong><br>The .omsview JSON file for the OMS Free Tier Solution Based Billing Tracker for the Security &amp; Audit Solution can now be downloaded from the <a href="https://gallery.technet.microsoft.com/Sample-OMS-Free-Tier-9ce2a390" target="_blank">TechNet Gallery</a>.<br><br>&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image589.png" width="381" height="211">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image_thumb561.png" width="378" height="214"><br>&nbsp;<br>The OMS Free Tier Solution Based Billing Tracker Dashboard – Security &amp; Audit consists of a summary tile on the main page of the OMS Portal that shows</p> <ol> <li>The <strong>number of computers</strong> connected and sending data to the Security &amp; Audit Solution  <li>A “<strong>1</strong>” if Solution Based Billing has been activated for the Security &amp; Audit Solution of this OMS Workspace, and “<strong>0</strong>” if otherwise,</li></ol> <p>within a default <strong>24 Hour </strong>window.<br></p> <p>The following views are available when drilling-in from the summary tile:</p> <ol> <li><strong>Information View</strong> – Provides a summary description for the OMS Free Tier Solution Based Billing Tracker - Security &amp; Audit Dashboard, links to obtain further information and to download the .omsview JSON file for the dashboard.  <li><strong>View 1 (Retention - 90 Days | Source - Azure Log)</strong> – Provides a last 24-hour summary of the number of times the Security &amp; Audit Solution was added successfully after June 19, 2017 on the <strong>2-Numbers Tile </strong>section, and lists the Security &amp; Audit Solution related activities captured in the <strong>Azure Activity Log</strong> after June 19, 2017, like Add or Remove, order by date and time on the <strong>List section</strong> of the View.  <li><strong>View 2 (Retention - 7 Days)</strong> – Provides a last 24-hour summary of the number of computers connected and sending data to the Security &amp;Audit Solution on the <strong>Single Number Tile </strong>section, and returns a “<strong>YES</strong>” if <strong>Billing </strong>has been enabled for the Security &amp; Audit Solution of the OMS Workspace <strong>in the Free Tier</strong> (when <strong>LinkedMeterId!="00000000-0000-0000-0000-000000000000"</strong>),<strong> </strong>and a “<strong>NO</strong>”<strong>&nbsp;</strong>if otherwise on the <strong>List section</strong> of the View.  <li><strong>View 3 (Retention - 7 Days)</strong> – Provides a chart of the total size of data uploaded by computers monitored by the Security &amp; Audit Solution (in MB) over a 24-hour period on the <strong>Line Chart &amp; Callout</strong> section, and returns a “<strong>YES</strong>” if <strong>Solution Based Billing </strong>specifically has been activated for the Security &amp; Audit Solution of the OMS Workspace <strong>in the Free Tier</strong> (when <strong>LinkedMeterId="15e6182d-2afe-4c9e-8c23-4062bd80b3d4" </strong>in the Free Tier),<strong> </strong>and a “<strong>NO</strong>”<strong>&nbsp;</strong>if otherwise on the <strong>List section</strong> of the View.</li></ol> <p><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image593.png" width="1080" height="346">&nbsp;<br><br><br>An OMS Workspace with the Security &amp; Audit Solution added <strong>before June 19, 2017 </strong>would look like this example:<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image603.png" width="1078" height="300"> <br>&nbsp;</p> <p><br>To implement the OMS Free Tier Solution Based Billing Tracker Dashboard – Security &amp; Audit Dashboard to an OMS Workspace, download the <strong><em>.omsview </em></strong>JSON file from the <a href="https://gallery.technet.microsoft.com/Sample-OMS-Free-Tier-9ce2a390" target="_blank">TechNet Gallery</a> and upload the file to the OMS Workspace using the <strong>Import</strong> option in the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-view-designer/" target="_blank">View Designer.</a><br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image590.png" width="367" height="115"> <br><br><br><br>Here is the main log search query that extends the <strong>Azure Activity Log </strong>records in Log Analytics and is used to lists the Security &amp; Audit Solution related activities captured after June 19, 2017: <br><span lang="EN-US" style="font-family: consolas"><strong>Type=AzureActivity Resource=Security TimeGenerated&gt;2017-06-19T00:00 | select OperationName, TimeGenerated</strong></span></p> <p>Here is the query that provides further filtering to look for records of the Security &amp; Audit Solution being added successfully after June 19, 2017:<br><span lang="EN-US" style="font-family: consolas"><strong>Type=AzureActivity Resource=Security ActivityStatus=Succeeded ActivitySubstatus=Created* TimeGenerated&gt;2017-06-19T00:00</strong></span></p> <p>Since the AzureActivity typed records from the Azure Activity Logs are available in an OMS Workspace for <strong>90 days</strong>, the list of Security &amp; Audit Solution related activities beyond 7 days after June 19, 2017, like when was the solution added or removed, can be retrieved with these log search query to help with further analysis or auditing. Note that if the Azure Subscription has multiple OMS Workspaces, then the Azure Activity Log will contain the events from all the OMS Workspaces and accessible in these Workspaces as well.<br>&nbsp;<br></p> <p>Here are the main log search queries that extends the Log Analytics Usage records and used within the<strong> </strong>Free Tier Solution Based Billing Tracker - Security &amp; Audit Dashboard to detect whether <strong>Solution Based Billing </strong>has been enabled for the Security and Audit Solution in an OMS Workspace in the <strong>Free Tier</strong>:</p> <ol> <li>Returns a “<strong>YES</strong>” if <strong>Billing</strong> has been enabled for the Security &amp; Audit Solution of the OMS Workspace in the Free Tier, and a “<strong>NO</strong>” if otherwise<br><span lang="EN-US" style="font-family: consolas"><strong>Type=Usage DataType=SecurityEvent MeterId="2073b0aa-c836-4642-9d97-0635f52e3520" | Extend if(termfreq(LinkedMeterId,"00000000-0000-0000-0000-000000000000"),"NO", "YES") as IsFreeTierBilled| select IsFreeTierBilled| Top 1</strong></span>  <li>Returns a “<strong>YES</strong>” if <strong>Solution Based Billing</strong> has been activated for the Security &amp; Audit Solution of the OMS Workspace in the Free Tier, and a “<strong>NO</strong>” if otherwise:<br><span lang="EN-US" style="font-family: consolas"><strong><span lang="EN-US" style="font-family: consolas"><strong>Type=Usage DataType=SecurityEvent MeterId="2073b0aa-c836-4642-9d97-0635f52e3520" | Extend if(termfreq(LinkedMeterId,"15e6182d-2afe-4c9e-8c23-4062bd80b3d4"),"YES","NO") as Billing| select Billing | Top 1</strong></span></strong></span></li></ol> <p>OMS Alerts can be configured to send notifications to recipients (via emails or SMS) if Solution Based Billing is enabled or Security &amp; Audit Solution activities from the Azure Activity Log is detected.<br><br><br>Here is a mapping of the <strong>Display Name to Meter ID GUID</strong> of some of the OMS Pricing Tiers:</p> <table width="524"> <tbody> <tr> <td width="18">&nbsp;</td> <td width="125"><strong>OMS Pricing Tier Display Name</strong></td> <td width="294"><strong>Meter ID GUID</strong></td> <td width="85"><strong>Comments</strong></td></tr> <tr> <td width="18">&nbsp;</td> <td width="125">Free</td> <td width="294">2073b0aa-c836-4642-9d97-0635f52e3520</td> <td width="85">&nbsp;</td></tr> <tr> <td width="18">&nbsp;</td> <td width="125">OMS</td> <td width="294">15e6182d-2afe-4c9e-8c23-4062bd80b3d4</td> <td width="85">Not Free</td></tr> <tr> <td width="18">&nbsp;</td> <td width="125">Standard</td> <td width="294">99762400-c6ee-4f87-91ba-0508f1638e21</td> <td width="85">Legacy</td></tr> <tr> <td width="18">&nbsp;</td> <td width="125">…</td> <td width="294">&nbsp;</td> <td width="85">&nbsp;</td></tr></tbody></table> <p><br><br>If the <strong>Linked Meter Id </strong>of <strong>SecurityEvent</strong> related <strong>Usage</strong> typed records from the Security &amp; Audit Solution is not overriden and still maintains the default value of <strong>"00000000-0000-0000-0000-000000000000"</strong>, it indicates that billing has not been enabled for the Security &amp; Audit Solution in this OMS Workspace, as shown in the picture below for an OMS Workspace in the Free Tier:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image591.png" width="463" height="294">&nbsp;<br><br><br>If the <strong>Linked Meter Id </strong>of <strong>SecurityEvent</strong> related <strong>Usage</strong> typed records from the Security &amp; Audit Solution is overriden with a value NOT EQUALS to&nbsp; <strong>"00000000-0000-0000-0000-000000000000"</strong>, it indicates that billing has been enabled for the Security &amp; Audit Solution in this OMS Workspace, and <strong>Solution Based Billing </strong>has been enabled if the Linked Meter Id is EQUAL to <strong>“15e6182d-2afe-4c9e-8c23-4062bd80b3d4"</strong>, as shown in the picture below for an OMS Workspace in the Free Tier:<br>&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image592.png" width="470" height="290">&nbsp; <br><br><strong><font color="#ff0000" size="3">In this case, after 60 days of trial for the continuous use of this solution, a per node billing will be applied.</font></strong><br><br><br><br></p> <p><font size="3" face="Arial"><em><br><br><br></p></em></font> <p><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.<br><br></font></p>]]></content:encoded>
    </item>
    <item>
      <title>OMS: Analyzing Data Ingestion &amp; Usage with the Free Tier Data Consumption Tracker</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/oms-analyzing-data-ingestion-usage-with-the-free-tier-data-consumption-tracker</link>
      <pubDate>Mon, 29 May 2017 05:28:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4415</guid>
      <description><![CDATA[The OMS Free Tier Data Consumption Tracker is a dashboard that extends the Log Analytics Usage...]]></description>
      <content:encoded><![CDATA[<p><a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2017/03/21/oms-free-tier-data-consumption-tracker-dashboard/" target="_blank">The OMS Free Tier Data Consumption Tracker</a> is a dashboard that extends the Log Analytics Usage records and provides a summary view of the data usage relative to the <strong>500 MB</strong> daily data upload limit of the OMS <a href="https://azure.microsoft.com/en-us/pricing/details/log-analytics/?ranMID=24542&amp;ranEAID=TnL5HPStwNw&amp;ranSiteID=TnL5HPStwNw-j6OIZndi_dHWpjrkM2FP6Q&amp;tduid=(d840c11ac56232e1a803e882b7cc2c41)(256380)(2459594)(TnL5HPStwNw-j6OIZndi_dHWpjrkM2FP6Q)()" target="_blank">Free Tier,</a> calculated in percentage. It provides a clearer picture on whether the daily upload limit of the Free Tier is being stretched or close to being hit when used in an OMS Workspace and can be downloaded from the <a href="https://gallery.technet.microsoft.com/Sample-OMS-Free-Tier-Data-9d9b2a66" target="_blank">TechNet Gallery</a>. </p> <p>This post provides some additional information on how we can utilize the <strong>Free Tier Data Consumption Tracker</strong> to understand OMS data ingestion behaviour and status of a particular OMS Workspace using the Free Tier.<br>&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image222.png" width="407" height="254"> <br><br><br>For an OMS Workspace using the <a href="https://azure.microsoft.com/en-us/pricing/details/log-analytics/?ranMID=24542&amp;ranEAID=TnL5HPStwNw&amp;ranSiteID=TnL5HPStwNw-j6OIZndi_dHWpjrkM2FP6Q&amp;tduid=(d840c11ac56232e1a803e882b7cc2c41)(256380)(2459594)(TnL5HPStwNw-j6OIZndi_dHWpjrkM2FP6Q)()" target="_blank">Free Tier</a>, if the daily data upload limit for the Free Tier is exceeded, data ingestion will stop (until <strong>UTC midnight</strong> when it will resume). However, this stop action does not take place immediately and it takes a little while longer for the data ingestion to fully come to a stop. Hence, some of the data collected beyond that limit will still show up in the OMS Portal.<br><br>The Free Tier Data Consumption Tracker uses a direct approach to calculate the percentage of the Free Tier data allowance used within the <strong>last 24 hours</strong> (<strong>NOW-24HOURS</strong>) regardless of whether it overlaps with UTC midnight or not. With this approach, if the data flows in to the OMS Workspace at a steady volume and the hourly data allowance used is on average safely below the hourly data limit of around 4%, then the <strong>% Quota Used</strong> value shown on the Tracker’s view will be a value that is below 100%. <br><br>When a value of <strong>over 100% </strong>is displayed on the Tracker, it could be due to the following reasons:</p> <ol> <li>When large volumes of data is collected within a small time window in the last 24 hours, causing the % Quota Used to spike up to a value more than 100%, as illustrated in the table below: <br>&nbsp; <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image223.png" width="1029" height="155">&nbsp; <br><br>On the <strong>Usage </strong>page, it could look like the following example where more than 500 MB of data was ingested into the OMS Workspace and only stops after 859 MB (171.8% of the Free Tier allowance) was ingested. <br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image224.png" width="1032" height="305"> <br><br><br>Another example below uses the <strong>time window chart </strong>on the top left of the Log Search page to show the relative size of the total number of records ingested per hour, by using the <em>Custom </em>setting to drill into a specific hourly window:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image225.png" width="396" height="255"> <br><br><br><strong>First hour after UTC midnight:</strong><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image226.png" width="865" height="307">&nbsp;<br><br><br><strong>2 hours after UTC midnight:</strong><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image227.png" width="853" height="296">&nbsp;<br><br><br><strong>3 hours after UTC midnight:</strong><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image234.png" width="869" height="309">&nbsp;<br><br><br><strong>4 hours after UTC midnight:</strong><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image229.png" width="858" height="297">&nbsp;<br><br><br><strong>5 hours after UTC midnight:&nbsp;&nbsp;&nbsp;&nbsp; </strong><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image230.png" width="869" height="308"> <br><br>The example above shows that data ingestion for this instance stops after the 4th hour window when 135.16% of the Free Tier allowance has been consumed.<br>&nbsp;<br><br> <li>When large volumes of data is collected in the last 24 hours and overlaps with UTC midnight where the 500 MB data allowance is resumed, causing the % Quota Used to spike up to a value more than 100% or even 200%, as illustrated in the table below: <br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image231.png" width="875" height="211"> <br><br><br>On the Tracker, it could look like the following example where more than 200% of the Free Tier allowance was consumed. <br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image232.png" width="324" height="200"> <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/06/image233.png" width="831" height="171"> </li></ol> <p><br><br>A % Quota Used value of over 100% is a good indicator that a particular OMS Workspace maybe receiving too much data due to configuration changes or something happening in the OMS monitored environment causing a sudden increase in the Or it could just be a case of the connected sources sending too much data daily to their OMS workspace via agent collection or the collector API etc and consuming all the Free Tier data allowance before reaching UTC midnight of the next day.<br><br><br>As demonstrated above, this “NOW-24HOURS” approach provides a straight forward summary of the overall data allowance consumption status and whether the daily upload limit of the Free Tier is being stretched or close to being exceeded to help OMS users make an educated decision on either to upgrade to the Standalone tier or to the E1/E2 subscriptions, to build on their existing investments while enjoying the larger data upload allowance or Premium solutions in the upgraded tiers.<br><br><br></p> <p><font size="3" face="Arial"><em><br><br></p></em></font> <p><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.<br><br></font></p>]]></content:encoded>
    </item>
    <item>
      <title>OpsMgr: Calculating the Overall Availability of Distributed Applications in Percentage</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/opsmgr-calculating-the-overall-availability-percentage-of-distributed-applications</link>
      <pubDate>Fri, 28 Apr 2017 10:58:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4305</guid>
      <description><![CDATA[This post demonstrates how we can calculate the percentage of availability of distributed...]]></description>
      <content:encoded><![CDATA[<p>This post demonstrates how we can calculate the <strong>percentage of availability</strong> of distributed application managed objects over time, based on the<strong> state of a specific monitor</strong> in System Center Operations Manager, with a <strong>PowerShell</strong> <strong>script</strong> that leverages <strong>OpsMgr Cmdlets</strong>.<br><br>The following picture shows an example of an OpsMgr native dashboard that consist of 2 widgets created from the <a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2016/01/05/opsmgr-sample-speedometer-gauge-widget-template/" target="_blank">Speedometer Gauge Widget Template</a> and the <a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2015/11/28/opsmgr-sample-powershell-text-display-widget-template/" target="_blank">PowerShell Text Display Widget Template</a>, displaying the percentage of availability of the <strong>Operations Manager Management Group </strong>distributed application object in two different ways. Both of these widgets are PowerShell-driven and use the same Powershell script from <strong>Sample Script 1</strong> below.<br>&nbsp;<br><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;border-left: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/04/image956.png" width="726" height="322">&nbsp; <br><br><br>The following picture shows an example of an OpsMgr native dashboard with 1 widget created from the <a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2016/09/01/opsmgr-sample-blue-bar-state-widget-template/" target="_blank">Blue Bar State Widget Template</a>, displaying the percentage of availability and number of state changes of all the distributed application objects in the management group, within the last 15 hours. This widget is also PowerShell-driven and uses the same Powershell script from <strong>Sample Script 2</strong> below.<br><br><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;border-left: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/04/image961.png" width="658" height="227"> <br><br><br><br>The specific monitor used to calculate the percentage of availability of the <strong>Operations Manager Management Group </strong>distributed application object over the last X hours, is the <strong>Entity Health (System.Health.EntityState) </strong>aggregate rollup monitor targeted to it. The <strong>Entity Health </strong>rollup monitor is the root rollup monitor for all managed objects and it determines the overall health state of each managed object based on the worst state of any of its members (default policy) consisting of unit, aggregate rollup or dependency monitors running against that managed object.<br><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;border-left: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/04/image957.png" width="831" height="351"> <br><br><br><br><strong>Sample Script 1</strong> calculates the percentage of availability of the <strong>Operations Manager Management Group </strong>distributed application object over <strong>X</strong> hours by <strong>summing up</strong> the total duration in seconds its <strong>Entity Health </strong>rollup monitor was in <strong>Healthy </strong>state between “now” and <strong>X </strong>hours ago, and dividing it with <strong>X * 3600</strong>. </p> <p>Here is an example of how <strong>Sample Script 1</strong> identifies state changes happening within the <strong>Entity Health </strong>rollup monitor<strong>, </strong>calculates the total time difference in seconds between each state change from <strong>Healthy </strong>to <strong>Not Healthy </strong>between “now” and 15 hours ago, and sums them all up in order to get the percentage of time the <strong>Operations Manager Management Group </strong>distributed application object was in <strong>Healthy state</strong> over the last 15 hours.<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/04/image958.png" width="935" height="409"> <br></p> <p><br><strong><u>Sample Script 1:</u></strong>&nbsp;</p> <p>Sample Script 1 takes into account the following conditions:</p> <ul> <li>If the initial state of the monitor is <strong>Healthy</strong> and <strong>No State Changes</strong> has been identified over the last X hours, then it is Available 100% of the time.</li> <li>If the initial state of the monitor is <strong>Not Healthy</strong> (in Warning or Error or Uninitialized) and <strong>No State Changes</strong> has been identified over the last X hours, then it is Available 0% of the time.</li> <li>If the first state change is a change <strong>from a Healthy to Not Healthy state</strong>, include the time difference between the start time and the time of that state change into the total time the monitor is in Healthy state.</li> <li>If the last state change is a change <strong>from a Not Healthy to Healthy state</strong>, include the time difference between the time of that state change and the current time (now) into the total time the monitor is in Healthy state.</li></ul> <p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:101c9ff3-d4ce-4f4e-91d7-6aff06c7f2f1" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 971px;height: 635px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">
</span><span style="color: #0000FF">function</span><span style="color: #000000"> New</span><span style="color: #000000">-</span><span style="color: #000000">Collection ( [type] </span><span style="color: #800080">$type</span><span style="color: #000000"> ) 
{
   </span><span style="color: #800080">$typeAssemblyName</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$type</span><span style="color: #000000">.AssemblyQualifiedName;
   </span><span style="color: #800080">$collection</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> new</span><span style="color: #000000">-</span><span style="color: #000000">object </span><span style="color: #800000">&quot;</span><span style="color: #800000">System.Collections.ObjectModel.Collection``1[[$typeAssemblyName]]</span><span style="color: #800000">&quot;</span><span style="color: #000000">;
   </span><span style="color: #0000FF">return</span><span style="color: #000000"> ,(</span><span style="color: #800080">$collection</span><span style="color: #000000">);
}

</span><span style="color: #800080">$newline</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`r`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> 

</span><span style="color: #008000">#</span><span style="color: #008000">Last x hours UTC</span><span style="color: #008000">
</span><span style="color: #800080">$backdateHour</span><span style="color: #000000">  </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">15</span><span style="color: #000000">  </span><span style="color: #008000">#</span><span style="color: #008000">NOTE: Replace with a numerical value for the time window in hours.</span><span style="color: #008000">
</span><span style="color: #000000">
</span><span style="color: #008000">#</span><span style="color: #008000">Get Entity Health Monitor</span><span style="color: #008000">
</span><span style="color: #800080">$monitorObject</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Get</span><span style="color: #000000">-</span><span style="color: #000000">SCOMMonitor </span><span style="color: #000000">-</span><span style="color: #000000">Name System.Health.EntityState

</span><span style="color: #008000">#</span><span style="color: #008000">Get the Distributed Application object. NOTE: Use the Object ID for more accuracy. </span><span style="color: #008000">
</span><span style="color: #800080">$DistributedApp</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> get</span><span style="color: #000000">-</span><span style="color: #000000">scomclassinstance </span><span style="color: #000000">-</span><span style="color: #000000">displayname </span><span style="color: #800000">&quot;</span><span style="color: #800000">Operations Manager Management Group</span><span style="color: #800000">&quot;</span><span style="color: #000000">

</span><span style="color: #008000">#</span><span style="color: #008000">Add monitor to collection</span><span style="color: #008000">
</span><span style="color: #800080">$monitorCollection</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> new</span><span style="color: #000000">-</span><span style="color: #000000">collection </span><span style="color: #800080">$monitorObject</span><span style="color: #000000">.GetType()
</span><span style="color: #800080">$monitorCollection</span><span style="color: #000000">.Add(</span><span style="color: #800080">$monitorObject</span><span style="color: #000000">)

</span><span style="color: #008000">#</span><span style="color: #008000">Get health state information of the Entity Health Monitor running against the Distributed Application object</span><span style="color: #008000">
</span><span style="color: #800080">$monitoringStates</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$DistributedApp</span><span style="color: #000000">.GetMonitoringStates(</span><span style="color: #800080">$monitorCollection</span><span style="color: #000000">)

</span><span style="color: #008000">#</span><span style="color: #008000">Get all state changes of the Entity Health Monitor running against the Distributed Application object</span><span style="color: #008000">
</span><span style="color: #800080">$stateChanges</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.GetMonitoringStateChangeEvents()

</span><span style="color: #008000">#</span><span style="color: #008000">Get start and end points of date time range</span><span style="color: #008000">
#</span><span style="color: #008000">Get current date time in UTC and date time X hours ago</span><span style="color: #008000">
</span><span style="color: #800080">$aggregationInterval</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$backdateHour</span><span style="color: #000000">
</span><span style="color: #800080">$dt</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> New</span><span style="color: #000000">-</span><span style="color: #000000">TimeSpan </span><span style="color: #000000">-</span><span style="color: #000000">hour </span><span style="color: #800080">$aggregationInterval</span><span style="color: #000000">
</span><span style="color: #800080">$nowlocal</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Get</span><span style="color: #000000">-</span><span style="color: #000000">Date
</span><span style="color: #008000">#</span><span style="color: #008000">Convert local time to UTC time</span><span style="color: #008000">
</span><span style="color: #800080">$now</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$nowlocal</span><span style="color: #000000">.ToUniversalTime()
</span><span style="color: #800080">$from</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$now</span><span style="color: #000000">.Subtract(</span><span style="color: #800080">$dt</span><span style="color: #000000">)

</span><span style="color: #008000">#</span><span style="color: #008000">Get all state changes between date time range and sort based on state change time</span><span style="color: #008000">
</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$stateChanges</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> where{</span><span style="color: #800080">$_</span><span style="color: #000000">.TimeGenerated </span><span style="color: #008080">-gt</span><span style="color: #000000"> </span><span style="color: #800080">$from</span><span style="color: #000000">} </span><span style="color: #000000">|</span><span style="color: #000000"> sort</span><span style="color: #000000">-</span><span style="color: #000000">object </span><span style="color: #000000">@</span><span style="color: #000000">{Expression</span><span style="color: #000000">=</span><span style="color: #000000">{</span><span style="color: #800080">$_</span><span style="color: #000000">.TimeGenerated}; Ascending</span><span style="color: #000000">=</span><span style="color: #0000FF">$true</span><span style="color: #000000">} 

</span><span style="color: #800080">$index</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">
</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">

</span><span style="color: #008000">#</span><span style="color: #008000">If state changes exists ...</span><span style="color: #008000">
</span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count </span><span style="color: #008080">-ne</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)
{

    </span><span style="color: #0000FF">foreach</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000"> </span><span style="color: #0000FF">in</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">)
    {    
        </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$index</span><span style="color: #000000"> </span><span style="color: #008080">-lt</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)
        {
            </span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.OldHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
            {
             </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #800080">$from</span><span style="color: #000000">
          </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds
            }
            </span><span style="color: #0000FF">else</span><span style="color: #000000">  </span><span style="color: #008000">#</span><span style="color: #008000">New State Equals Success</span><span style="color: #008000">
</span><span style="color: #000000">            {  
                </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000"> </span><span style="color: #008080">-and</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.NewHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">) </span><span style="color: #008000">#</span><span style="color: #008000">Only 1 single state change</span><span style="color: #008000">
</span><span style="color: #000000">                {
                    </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$now</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated
                    </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds               
                }
            }

        }
        </span><span style="color: #0000FF">else</span><span style="color: #000000">
        {
            </span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.OldHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
            {
                </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated</span><span style="color: #000000">-</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">[</span><span style="color: #800080">$index</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">].TimeGenerated
                </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds                
            }
         </span><span style="color: #0000FF">else</span><span style="color: #000000">
         {
         
             </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$index</span><span style="color: #000000"> </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000"> </span><span style="color: #008080">-and</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.NewHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
                {
                    </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$now</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated
                    </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds               
                }         
         }  
        }
        </span><span style="color: #800080">$index</span><span style="color: #000000">++</span><span style="color: #000000">
    }
}
</span><span style="color: #0000FF">else</span><span style="color: #000000"> </span><span style="color: #008000">#</span><span style="color: #008000"> if no state change exist</span><span style="color: #008000">
</span><span style="color: #000000">{
    </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.HealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
    {</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$backdateHour</span><span style="color: #000000">*</span><span style="color: #000000">3600</span><span style="color: #000000">}
    </span><span style="color: #0000FF">else</span><span style="color: #000000">
    {</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">}

}

</span><span style="color: #008000">#</span><span style="color: #008000">Calculate percentage of availability of the distributed application object</span><span style="color: #008000">
</span><span style="color: #800080">$PercentAvailable</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Math]</span><span style="color: #000000">::</span><span style="color: #000000">Round((</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000">/</span><span style="color: #000000">(</span><span style="color: #000000">3600</span><span style="color: #000000">*</span><span style="color: #800080">$backdateHour</span><span style="color: #000000">))</span><span style="color: #000000">*</span><span style="color: #000000">100</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">)

</span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.HealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
{
    </span><span style="color: #800080">$HealthState1</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Healthy</span><span style="color: #800000">&quot;</span><span style="color: #000000">
}
</span><span style="color: #0000FF">else</span><span style="color: #000000">
{
    </span><span style="color: #800080">$HealthState1</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.HealthState
}

</span><span style="color: #800080">$result</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Current Health State of </span><span style="color: #800000">&quot;</span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$DistributedApp</span><span style="color: #000000">.displayName </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000"> is </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$HealthState1</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">, was available </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> [String]</span><span style="color: #800080">$PercentAvailable</span><span style="color: #000000">  </span><span style="color: #000000">+</span><span style="color: #800000">&quot;</span><span style="color: #800000">% of the time over the last </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$backdateHour</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000"> hour(s).</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$newline</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$newline</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Number of State Changes: </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$newline</span><span style="color: #000000">

</span><span style="color: #800080">$result</span><span style="color: #000000">

</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div></p>
<p>&nbsp;</p>
<p>The following picture shows another example of an OpsMgr native dashboard with the Speedometer and Text Display widgets, displaying the percentage of availability of the <strong>Operations Manager Management Group </strong>distributed application object in two difference ways, but this time, its above the 80% threshold.<br><br><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;border-left: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/04/image959.png" width="733" height="320">&nbsp;<br><br><br></p>
<p><strong><u>Sample Script 2:</u></strong>&nbsp;</p>
<p><strong>Sample Script 2</strong> is similar to <strong>Sample Scrip1</strong>. The only difference is that the script returns all distributed application objects under the <strong>System.Service</strong> class and loops through to calculate their overall percentage of availability to produce the following result:<br><br><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;border-left: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/04/image960.png" width="959" height="205"></p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:0eb6ca77-03d3-40ce-915d-824be3e283aa" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 968px;height: 665px;background-color:#FFFFBF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">
</span><span style="color: #0000FF">function</span><span style="color: #000000"> New</span><span style="color: #000000">-</span><span style="color: #000000">Collection ( [type] </span><span style="color: #800080">$type</span><span style="color: #000000"> ) 
{
   </span><span style="color: #800080">$typeAssemblyName</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$type</span><span style="color: #000000">.AssemblyQualifiedName;
   </span><span style="color: #800080">$collection</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> new</span><span style="color: #000000">-</span><span style="color: #000000">object </span><span style="color: #800000">&quot;</span><span style="color: #800000">System.Collections.ObjectModel.Collection``1[[$typeAssemblyName]]</span><span style="color: #800000">&quot;</span><span style="color: #000000">;
   </span><span style="color: #0000FF">return</span><span style="color: #000000"> ,(</span><span style="color: #800080">$collection</span><span style="color: #000000">);
}

</span><span style="color: #800080">$newline</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`r`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> 

</span><span style="color: #008000">#</span><span style="color: #008000">Last x hours UTC</span><span style="color: #008000">
</span><span style="color: #800080">$backdateHour</span><span style="color: #000000">  </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">15</span><span style="color: #000000">  </span><span style="color: #008000">#</span><span style="color: #008000">NOTE: Replace with a numerical value for the time window in hours.</span><span style="color: #008000">
</span><span style="color: #000000">
</span><span style="color: #800080">$monitorObject</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Get</span><span style="color: #000000">-</span><span style="color: #000000">SCOMMonitor </span><span style="color: #000000">-</span><span style="color: #000000">Name System.Health.EntityState

</span><span style="color: #008000">#</span><span style="color: #008000">Get parent Class for all Distributed Applications</span><span style="color: #008000">
</span><span style="color: #800080">$class</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> get</span><span style="color: #000000">-</span><span style="color: #000000">scomclass </span><span style="color: #000000">-</span><span style="color: #000000">Name System.Service
</span><span style="color: #008000">#</span><span style="color: #008000">Return all Distributed Application Objects</span><span style="color: #008000">
</span><span style="color: #800080">$DistributedApps</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> get</span><span style="color: #000000">-</span><span style="color: #000000">scomclassinstance </span><span style="color: #000000">-</span><span style="color: #000000">clas </span><span style="color: #800080">$class</span><span style="color: #000000">

</span><span style="color: #008000">#</span><span style="color: #008000">Add monitor to collection</span><span style="color: #008000">
</span><span style="color: #800080">$monitorCollection</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> new</span><span style="color: #000000">-</span><span style="color: #000000">collection </span><span style="color: #800080">$monitorObject</span><span style="color: #000000">.GetType()
</span><span style="color: #800080">$monitorCollection</span><span style="color: #000000">.Add(</span><span style="color: #800080">$monitorObject</span><span style="color: #000000">)

</span><span style="color: #0000FF">ForEach</span><span style="color: #000000">(</span><span style="color: #800080">$DistributedApp</span><span style="color: #000000"> </span><span style="color: #0000FF">in</span><span style="color: #000000"> </span><span style="color: #800080">$DistributedApps</span><span style="color: #000000">)
{
</span><span style="color: #008000">#</span><span style="color: #008000">Get health state information of the Entity Health Monitor running against the Distributed Application object</span><span style="color: #008000">
</span><span style="color: #800080">$monitoringStates</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$DistributedApp</span><span style="color: #000000">.GetMonitoringStates(</span><span style="color: #800080">$monitorCollection</span><span style="color: #000000">)

</span><span style="color: #008000">#</span><span style="color: #008000">Get all state changes of the Entity Health Monitor running against the Distributed Application object</span><span style="color: #008000">
</span><span style="color: #800080">$stateChanges</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.GetMonitoringStateChangeEvents()

</span><span style="color: #008000">#</span><span style="color: #008000">Get start and end points of date time range</span><span style="color: #008000">
#</span><span style="color: #008000">Get current date time in UTC and date time X hours ago</span><span style="color: #008000">
</span><span style="color: #800080">$aggregationInterval</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$backdateHour</span><span style="color: #000000">
</span><span style="color: #800080">$dt</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> New</span><span style="color: #000000">-</span><span style="color: #000000">TimeSpan </span><span style="color: #000000">-</span><span style="color: #000000">hour </span><span style="color: #800080">$aggregationInterval</span><span style="color: #000000">
</span><span style="color: #800080">$nowlocal</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Get</span><span style="color: #000000">-</span><span style="color: #000000">Date
</span><span style="color: #008000">#</span><span style="color: #008000">Convert local time to UTC time</span><span style="color: #008000">
</span><span style="color: #800080">$now</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$nowlocal</span><span style="color: #000000">.ToUniversalTime()
</span><span style="color: #800080">$from</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$now</span><span style="color: #000000">.Subtract(</span><span style="color: #800080">$dt</span><span style="color: #000000">)

</span><span style="color: #008000">#</span><span style="color: #008000">Get all state changes between date time range and sort based on state change time</span><span style="color: #008000">
</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$stateChanges</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> where{</span><span style="color: #800080">$_</span><span style="color: #000000">.TimeGenerated </span><span style="color: #008080">-gt</span><span style="color: #000000"> </span><span style="color: #800080">$from</span><span style="color: #000000">} </span><span style="color: #000000">|</span><span style="color: #000000"> sort</span><span style="color: #000000">-</span><span style="color: #000000">object </span><span style="color: #000000">@</span><span style="color: #000000">{Expression</span><span style="color: #000000">=</span><span style="color: #000000">{</span><span style="color: #800080">$_</span><span style="color: #000000">.TimeGenerated}; Ascending</span><span style="color: #000000">=</span><span style="color: #0000FF">$true</span><span style="color: #000000">} 

</span><span style="color: #800080">$index</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">
</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">

</span><span style="color: #008000">#</span><span style="color: #008000">If state changes exists ...</span><span style="color: #008000">
</span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count </span><span style="color: #008080">-ne</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)
{

    </span><span style="color: #0000FF">foreach</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000"> </span><span style="color: #0000FF">in</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">)
    {    
        </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$index</span><span style="color: #000000"> </span><span style="color: #008080">-lt</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)
        {
            </span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.OldHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
            {
             </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #800080">$from</span><span style="color: #000000">
          </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds
            }
            </span><span style="color: #0000FF">else</span><span style="color: #000000">  </span><span style="color: #008000">#</span><span style="color: #008000">New State Equals Success</span><span style="color: #008000">
</span><span style="color: #000000">            {  
                </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000"> </span><span style="color: #008080">-and</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.NewHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">) </span><span style="color: #008000">#</span><span style="color: #008000">Only 1 single state change</span><span style="color: #008000">
</span><span style="color: #000000">                {
                    </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$now</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated
                    </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds               
                }
            }

        }
        </span><span style="color: #0000FF">else</span><span style="color: #000000">
        {
            </span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.OldHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
            {
                </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated</span><span style="color: #000000">-</span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">[</span><span style="color: #800080">$index</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">].TimeGenerated
                </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds                
            }
         </span><span style="color: #0000FF">else</span><span style="color: #000000">
         {
         
             </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$index</span><span style="color: #000000"> </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000"> </span><span style="color: #008080">-and</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.NewHealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
                {
                    </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$now</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSorted</span><span style="color: #000000">.TimeGenerated
                    </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$TimeDiff</span><span style="color: #000000">.TotalSeconds               
                }         
         }  
        }
        </span><span style="color: #800080">$index</span><span style="color: #000000">++</span><span style="color: #000000">
    }
}
</span><span style="color: #0000FF">else</span><span style="color: #000000"> </span><span style="color: #008000">#</span><span style="color: #008000"> if no state change exist</span><span style="color: #008000">
</span><span style="color: #000000">{
    </span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.HealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
    {</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$backdateHour</span><span style="color: #000000">*</span><span style="color: #000000">3600</span><span style="color: #000000">}
    </span><span style="color: #0000FF">else</span><span style="color: #000000">
    {</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">}
}

</span><span style="color: #800080">$PercentAvailable</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Math]</span><span style="color: #000000">::</span><span style="color: #000000">Round((</span><span style="color: #800080">$TotalTimeDiff</span><span style="color: #000000">/</span><span style="color: #000000">(</span><span style="color: #000000">3600</span><span style="color: #000000">*</span><span style="color: #800080">$backdateHour</span><span style="color: #000000">))</span><span style="color: #000000">*</span><span style="color: #000000">100</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">)

</span><span style="color: #008000">#</span><span style="color: #008000">Calculate percentage of availability of the distributed application object</span><span style="color: #008000">
</span><span style="color: #0000FF">if</span><span style="color: #000000">(</span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.HealthState </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
{
    </span><span style="color: #800080">$HealthState1</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Healthy</span><span style="color: #800000">&quot;</span><span style="color: #000000">
}
</span><span style="color: #0000FF">else</span><span style="color: #000000">
{
    </span><span style="color: #800080">$HealthState1</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$monitoringStates</span><span style="color: #000000">.HealthState
}

</span><span style="color: #800080">$result</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Current Health State of </span><span style="color: #800000">&quot;</span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$DistributedApp</span><span style="color: #000000">.displayName </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000"> is </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$HealthState1</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">, was available </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> [String]</span><span style="color: #800080">$PercentAvailable</span><span style="color: #000000">  </span><span style="color: #000000">+</span><span style="color: #800000">&quot;</span><span style="color: #800000">% of the time over the last </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$backdateHour</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000"> hour(s).</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$newline</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$newline</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Number of State Changes: </span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$stateChangesSortedx</span><span style="color: #000000">.count </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$newline</span><span style="color: #000000">

</span><span style="color: #800080">$result</span><span style="color: #000000">
}</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p><br><br><br><strong><font color="#808000" size="3"><u>IMPORTANT NOTE about Sample Script 1 and Sample Script 2:</u></font></strong><br><br>Both sample scripts assume that the distributed application objects are always <strong>NOT in a greyed out state </strong>and hence also assumes that the management server(s) managing them are always available and running.<br><br><br></p>
<p><font size="3" face="Arial"><em><br><br></p></em></font>
<p><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.<br><br></font></p>]]></content:encoded>
    </item>
    <item>
      <title>OMS Free Tier Data Consumption Tracker Dashboard</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/oms-free-tier-data-consumption-tracker-dashboard</link>
      <pubDate>Tue, 21 Mar 2017 10:06:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4226</guid>
      <description><![CDATA[In Operations Management Suite (OMS), there is a Free Tier that allows up to 500 MB of data upload...]]></description>
      <content:encoded><![CDATA[<br><font size="3">In Operations Management Suite (OMS), there is a </font><a href="https://azure.microsoft.com/en-us/pricing/details/log-analytics/?ranMID=24542&amp;ranEAID=TnL5HPStwNw&amp;ranSiteID=TnL5HPStwNw-j6OIZndi_dHWpjrkM2FP6Q&amp;tduid=(d840c11ac56232e1a803e882b7cc2c41)(256380)(2459594)(TnL5HPStwNw-j6OIZndi_dHWpjrkM2FP6Q)()" target="_blank"><font size="3">Free Tier</font></a><font size="3"> that allows up to <strong>500 MB</strong> of data upload per day for Log Analytics, with 7 days of data retention. For more information on the latest OMS tiers and subscription plans available including their pricings, please visit the </font><a href="https://www.microsoft.com/en-au/cloud-platform/operations-management-suite-pricing" target="_blank"><font size="3">Operations Management Suite Pricing site</font></a><font size="3">. <br></font> <p><font size="3">This post features a custom OMS Dashboard – the <strong>Free Tier Data Consumption Tracker</strong> - that extends the <strong>Log Analytics Usage records</strong> used primarily to drive the </font><a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-usage"><font size="3">Usage Dashboard</font></a><font size="2"><font size="3">. It provides a summary view of the data quota consumption relative to the 500 MB daily data upload limit of the OMS Free Tier, calculated in percentage. The <em>.omsview</em> JSON file for the OMS Free Tier Data Consumption Tracker Dashboard can now be downloaded from the <a href="https://gallery.technet.microsoft.com/Sample-OMS-Free-Tier-Data-9d9b2a66" target="_blank">TechNet Gallery</a>.</font><br></font><font size="3">&nbsp;<br>&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/2017/03/image529.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/03/image_thumb500.png" width="381" height="208"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/03/image530.png" width="375" height="209">&nbsp; <br><br></font><font size="3">My personal view is that having the Free Tier in OMS is an advantage as it not only allows the end user to try out the services and solutions in OMS for free, it also allow solution developers and service providers to test the waters with their custom solutions and plan their customer POCs without having to deal with the complexities of billing and usage charges up front. <br>However, if the daily data upload limit for the Free Tier is exceeded, data beyond that limit will not be analysed and records will stop showing up in the OMS Portal. Therefore, this dashboard will be able to provide a clearer picture of the overall data consumption status and whether the daily upload limit of the Free Tier is being stretched or close to being hit when used in an OMS Workspace.<br></font><br>The OMS Free Tier Data Consumption Tracker Dashboard consists of a summary tile on the main page of the OMS Portal that shows how much of the Free Tier daily upload limit has been consumed by all the billable solutions used in the OMS Workspace. The following views are available when drill-in from the summary tile:</p> <ol> <li><strong>Information View</strong> – Provides a summary description for the OMS Free Tier Data Consumption Tracker Dashboard, links to obtain further information and to download the <em>.omsview</em> JSON file for the dashboard.  <li><strong>Free Tier Data Consumption by Solution &amp; DataType View</strong> – Provides a last 24-hour summary of the overall Free Tier billable data consumption broken down by Solution on the <strong>Donut section</strong>, and listing the names of all the OMS DataTypes and their corresponding Solution with the highest Free Tier quota usage, with a monitor that will change state when their % Quota Used exceed thresholds: <strong>Above 75=Warning and Above 95=Error</strong>, on the <strong>List section</strong> of the View.  <li><strong>For Nodes/Endpoints/Computers Only View – </strong>Provides a last 24-hour summary of the overall Free Tier billable data consumption caused by <strong>Nodes/Endpoints/Computers </strong>only, broken down by DataType on the <strong>Donut section</strong>, and listing the names of all the OMS Nodes/Endpoints/Computers<strong> </strong>and their corresponding DataType with the highest Free Tier quota usage, with a monitor that will change state when their % Quota Used exceed thresholds: <strong>Above 75=Warning and Above 95=Error</strong>, on the <strong>List section</strong> of the View.  <li><strong>For Non-Nodes View – </strong>Provides a last 24-hour summary of the overall Free Tier billable data consumption caused by <strong>non-Nodes </strong>(records Data not associated with a computernot associated to any <strong>Node/Endpoint/Computer</strong>), broken down by DataType on the <strong>Donut section</strong>, and listing the names of all the non-Nodes<strong> </strong>and their corresponding DataType with the highest Free Tier quota usage, with a monitor that will change state when their % Quota Used exceed thresholds: <strong>Above 75=Warning and Above 95=Error</strong>, on the <strong>List section</strong> of the View.  <li><strong>Billable vs Non-Billable Usage View - </strong>Provides a last 24-hour summary of the overall <strong>non-billable</strong> data usage to the Free Tier comparison, broken down by DataType on the <strong>Donut section</strong>, and displaying the total billable Free Tier quota usage, with a monitor that will change state when it’s % Quota Used exceeds thresholds: <strong>Above 75=Warning and Above 99=Error</strong>, on the <strong>List section</strong> of the View.</li></ol> <p><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/03/image534.png" width="1457" height="513">&nbsp;<br><br>&nbsp;<br><font size="3">To implement the OMS Free Tier Data Consumption Tracker Dashboard to an OMS Workspace, download the <em><strong>.omsview</strong></em> JSON file from the <a href="https://gallery.technet.microsoft.com/Sample-OMS-Free-Tier-Data-9d9b2a66" target="_blank">TechNet Gallery</a> and upload the file to the OMS Workspace using the <strong>Import </strong>option in the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-view-designer/" target="_blank">View Designer</a>.<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2017/03/image535.png" width="389" height="124">&nbsp;<br><br><br><br>Here is the main query that extends the <strong>Log Analytics Usage records</strong> and is used to drive each of the Views within the Free Tier Data Consumption Tracker Dashboard. It filters the record of <strong>Type=Usage</strong>, to summarize and display them accordingly: </font></p> <p class="MsoNormal"><em><b><span lang="EN-US" style="font-family: consolas;color: #0070c0;font-style: normal">Type=Usage QuantityUnit="MBytes" IsBillable=true TimeGenerated&gt;NOW-24HOURS | Extend mul(Quantity,0.2) AS UsedFreeTierPercent | measure sum(UsedFreeTierPercent) AS TotalUsedFreeTierPercent by Solution</span></b></em></p> <p><font size="3"><br><br><br><br></font>&nbsp;</p> <p><font size="3"><strong>Additional Resources:</strong> </font></p> <p>Analyze data usage in Log Analytics by Richard Rundle<br><a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-usage" target="_blank">https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-usage</a>  <p>Get notified if OMS Log Analytics usage is higher than expected by Richard Rundle<br><a title="https://blogs.technet.microsoft.com/msoms/2016/11/21/get-notified-if-oms-log-analytics-usage-is-higher-than-expected/" href="https://blogs.technet.microsoft.com/msoms/2016/11/21/get-notified-if-oms-log-analytics-usage-is-higher-than-expected/" target="_blank">https://blogs.technet.microsoft.com/msoms/2016/11/21/get-notified-if-oms-log-analytics-usage-is-higher-than-expected/</a><br><br>Arithmetic operations meet aggregate queries in OMS by Leyla Kazemi<br><a title="https://blogs.technet.microsoft.com/msoms/2016/09/13/arithmetic-operations-meet-aggregate-queries-in-oms/" href="https://blogs.technet.microsoft.com/msoms/2016/09/13/arithmetic-operations-meet-aggregate-queries-in-oms/">https://blogs.technet.microsoft.com/msoms/2016/09/13/arithmetic-operations-meet-aggregate-queries-in-oms/</a><font size="3" face="Arial"><em><br></em></font></p> <p><font size="3" face="Arial"><em>&nbsp;<br><br></p></em></font> <p><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.<br><br></font></p>]]></content:encoded>
    </item>
    <item>
      <title>OMS Dashboard Extension for the Upgrade Helper MP for SCOM 2012 R2 to 2016</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/oms-dashboard-extension-for-the-upgrade-helper-mp-for-scom-2012-r2-to-2016</link>
      <pubDate>Sun, 30 Oct 2016 23:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4145</guid>
      <description><![CDATA[The Upgrade Helper For SCOM 2012 R2 to 2016 Dashboard extends the new Upgrade Helper Management Pack...]]></description>
      <content:encoded><![CDATA[<p>The <strong>Upgrade Helper For SCOM 2012 R2 to 2016 Dashboard</strong> extends the <a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2016/10/03/introducing-the-new-upgrade-helper-mp-for-scom-2012-r2-to-2016/" target="_blank">new Upgrade Helper Management Pack</a> to Operations Management Suite (OMS). It provides a summary view of the overall upgrade state of a System Center Operations Manager Management Group moving from 2012 R2 to 2016, and is accessible through the OMS Portal.<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1091.png" width="378" height="212">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1092.png" width="378" height="210"> <br><br>The Upgrade Helper Management Pack, the <strong><em>.omsview</em></strong> JSON file for the OMS Upgrade Helper Dashboard and the collection script can now be downloaded from the <a href="https://gallery.technet.microsoft.com/Sample-Management-Pack-fd15caa7" target="_blank">TechNet Gallery</a>.<br><br>The OMS Upgrade Helper Dashboard consists of a summary tile on the main page of the OMS Portal that shows the number and percentage of core components already upgraded or not upgraded to OpsMgr 2016 within a management group of interest, and the following views are available when drill-in from the summary tile:</p> <ol> <li><strong>Information View</strong>&nbsp;<strong>–</strong> Provides a summary description for the OMS Upgrade Helper Dashboard, links to obtain further information and to download the Upgrade Helper Management Pack, the <strong><em>.</em></strong>omsview JSON file for and the collection script.  <li><strong>Upgrade State of Core Components View –</strong> Provides a summary of the overall upgrade state of the <strong>core components</strong> of the management group of interest by showing the percentage and number of core components already upgraded or not upgraded to OpsMgr 2016 on the Donut section, and listing the names of all the core components, their upgrade state and their roles on the List section of the View.  <li><strong>Upgrade State of Agents View</strong> <strong>–</strong> Provides a summary of the overall upgrade state of the <strong>agents </strong>of the management group of interest by showing the percentage and number of agents already upgraded or not upgraded to OpsMgr 2016 on the Donut section, and only listing the names and versions of each agents that have yet to be upgraded on the List section of the View.  <li><strong>SCOM Agent Patch List View</strong> – Provides a count of the total number of agents found in the management group of interest on the Single Number section, and a list of agent patches identified with the number of occurrences found for each patch list in the management group of interest on the List section of the View.</li></ol> <p>&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1093.png" width="1456" height="585"> <br><br>Here are the steps on how to:</p> <ul> <li>Implement the OMS Upgrade Helper Dashboard to an OMS Workspace, and  <li>Collect and send the required upgrade state data of a management group to the OMS Workspace to be displayed on the Upgrade Helper Dashboard.<br></li></ul> <p>To implement the OMS Upgrade Helper Dashboard to an OMS Workspace, download the <em><strong>.omsview</strong></em> JSON file from the <a href="https://gallery.technet.microsoft.com/Sample-Management-Pack-fd15caa7" target="_blank">TechNet Gallery</a> and upload the file to the OMS Workspace using the <strong>Import </strong>option in the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-view-designer/" target="_blank">View Designer</a>.<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1094.png" width="371" height="118">&nbsp;<br><br><br>To collect and send the required upgrade state data of a management group to an OMS Workspace, use the sample <strong>data</strong> <strong>collection script</strong> that can be downloaded together with the .<em><strong>omsview</strong></em> JSON file from the <a href="https://gallery.technet.microsoft.com/Sample-Management-Pack-fd15caa7" target="_blank">TechNet Gallery</a>. The sample collection script is written in PowerShell and leverages the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/" target="_blank">OMS HTTP Collector API</a>&nbsp; to introduce a <strong>Custom Log Type </strong>for the upgrade state data – <em>&nbsp;<strong>OM16UpgradeState</strong>, </em>and to send the collected data to the OMS Workspace in a JSON payload.<br><br>Here is the sample PowerShell script used in the data collection script (<em>UpgradeStatusCollectionScript.SendtoOMS.v1.ps1</em>):<br><font color="#ff0000"><strong><u>IMPORTANT NOTE:</u></strong></font> <br><strong>This collection script must either be <font color="#0000ff">(1.)</font> run on the <em>Operations Manager Shell </em>or in a PowerShell session with the <em>OperationsManager module</em> imported, <font color="#0000ff">(2.)</font> connected to the Operations Manager management group of interest <font color="#0000ff">(3.)</font> with t<strong>he <u>Upgrade Helper Management Pack imported</u></strong>, and <font color="#0000ff">(4.)</font> have access to the internet via HTTP.</strong></p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:2ae18e56-2989-47c6-aec7-7ee876881245" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1049px;height: 743px;background-color:White;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #008000">#</span><span style="color: #008000"> Replace with your Workspace ID</span><span style="color: #008000">
</span><span style="color: #800080">$CustomerId</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</span><span style="color: #800000">&quot;</span><span style="color: #000000"> 
  
</span><span style="color: #008000">#</span><span style="color: #008000"> Replace with your Primary Key</span><span style="color: #008000">
</span><span style="color: #800080">$SharedKey</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span><span style="color: #800000">&quot;</span><span style="color: #000000">

</span><span style="color: #008000">#</span><span style="color: #008000">Specify the name of the record type that we'll be creating.</span><span style="color: #008000">
</span><span style="color: #800080">$LogType</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">OM16UpgradeState</span><span style="color: #800000">&quot;</span><span style="color: #000000">

</span><span style="color: #008000">#</span><span style="color: #008000">Specify a time in the format YYYY-MM-DDThh:mm:ssZ to specify a created time for the records.</span><span style="color: #008000">
</span><span style="color: #800080">$TimeStampField</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">

</span><span style="color: #800080">$coreComponentArray</span><span style="color: #000000">=@</span><span style="color: #000000">()
</span><span style="color: #800080">$agentCollectionArray</span><span style="color: #000000">=@</span><span style="color: #000000">()

</span><span style="color: #008000">#</span><span style="color: #008000"> Function to create the authorization signature.</span><span style="color: #008000">
</span><span style="color: #0000FF">Function</span><span style="color: #000000"> Build</span><span style="color: #000000">-</span><span style="color: #000000">Signature (</span><span style="color: #800080">$customerId</span><span style="color: #000000">, </span><span style="color: #800080">$sharedKey</span><span style="color: #000000">, </span><span style="color: #800080">$date</span><span style="color: #000000">, </span><span style="color: #800080">$contentLength</span><span style="color: #000000">, </span><span style="color: #800080">$method</span><span style="color: #000000">, </span><span style="color: #800080">$contentType</span><span style="color: #000000">, </span><span style="color: #800080">$resource</span><span style="color: #000000">)
{
    </span><span style="color: #800080">$xHeaders</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">x-ms-date:</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$date</span><span style="color: #000000">
    </span><span style="color: #800080">$stringToHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$method</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$contentLength</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$contentType</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$xHeaders</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$resource</span><span style="color: #000000">

    </span><span style="color: #800080">$bytesToHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Text.Encoding]</span><span style="color: #000000">::</span><span style="color: #000000">UTF8.GetBytes(</span><span style="color: #800080">$stringToHash</span><span style="color: #000000">)
    </span><span style="color: #800080">$keyBytes</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Convert]</span><span style="color: #000000">::</span><span style="color: #000000">FromBase64String(</span><span style="color: #800080">$sharedKey</span><span style="color: #000000">)

    </span><span style="color: #800080">$sha256</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> New</span><span style="color: #000000">-</span><span style="color: #000000">Object System.Security.Cryptography.HMACSHA256
    </span><span style="color: #800080">$sha256</span><span style="color: #000000">.Key </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$keyBytes</span><span style="color: #000000">
    </span><span style="color: #800080">$calculatedHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$sha256</span><span style="color: #000000">.ComputeHash(</span><span style="color: #800080">$bytesToHash</span><span style="color: #000000">)
    </span><span style="color: #800080">$encodedHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Convert]</span><span style="color: #000000">::</span><span style="color: #000000">ToBase64String(</span><span style="color: #800080">$calculatedHash</span><span style="color: #000000">)
    </span><span style="color: #800080">$authorization</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> 'SharedKey {</span><span style="color: #000000">0</span><span style="color: #000000">}:{</span><span style="color: #000000">1</span><span style="color: #000000">}' </span><span style="color: #008080">-f</span><span style="color: #000000"> </span><span style="color: #800080">$customerId</span><span style="color: #000000">,</span><span style="color: #800080">$encodedHash</span><span style="color: #000000">
    </span><span style="color: #0000FF">return</span><span style="color: #000000"> </span><span style="color: #800080">$authorization</span><span style="color: #000000">
}

</span><span style="color: #008000">#</span><span style="color: #008000"> Function to create and post the request</span><span style="color: #008000">
</span><span style="color: #0000FF">Function</span><span style="color: #000000"> Post</span><span style="color: #000000">-</span><span style="color: #000000">OMSData(</span><span style="color: #800080">$customerId</span><span style="color: #000000">, </span><span style="color: #800080">$sharedKey</span><span style="color: #000000">, </span><span style="color: #800080">$body</span><span style="color: #000000">, </span><span style="color: #800080">$logType</span><span style="color: #000000">) 
{
    </span><span style="color: #800080">$method</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">POST</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    </span><span style="color: #800080">$contentType</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">application/json</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    </span><span style="color: #800080">$resource</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">/api/logs</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    </span><span style="color: #800080">$rfc1123date</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [DateTime]</span><span style="color: #000000">::</span><span style="color: #000000">UtcNow.ToString(</span><span style="color: #800000">&quot;</span><span style="color: #800000">r</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
    </span><span style="color: #800080">$contentLength</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$body</span><span style="color: #000000">.Length
     </span><span style="color: #800080">$signature</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Build</span><span style="color: #000000">-</span><span style="color: #000000">Signature `
        </span><span style="color: #000000">-</span><span style="color: #000000">customerId </span><span style="color: #800080">$customerId</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">sharedKey </span><span style="color: #800080">$sharedKey</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">date </span><span style="color: #800080">$rfc1123date</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">contentLength </span><span style="color: #800080">$contentLength</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">fileName </span><span style="color: #800080">$fileName</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">method </span><span style="color: #800080">$method</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">contentType </span><span style="color: #800080">$contentType</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">resource </span><span style="color: #800080">$resource</span><span style="color: #000000">
    </span><span style="color: #800080">$uri</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">https://</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$customerId</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">.ods.opinsights.azure.com</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$resource</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">?api-version=2016-04-01</span><span style="color: #800000">&quot;</span><span style="color: #000000">

    </span><span style="color: #800080">$headers</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">@</span><span style="color: #000000">{
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Authorization</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$signature</span><span style="color: #000000">;
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Log-Type</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$logType</span><span style="color: #000000">;
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">x-ms-date</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$rfc1123date</span><span style="color: #000000">;
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">time-generated-field</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TimeStampField</span><span style="color: #000000">;
    }

    </span><span style="color: #800080">$response</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Invoke</span><span style="color: #000000">-</span><span style="color: #000000">WebRequest </span><span style="color: #000000">-</span><span style="color: #000000">Uri </span><span style="color: #800080">$uri</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">Method </span><span style="color: #800080">$method</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">ContentType </span><span style="color: #800080">$contentType</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">Headers </span><span style="color: #800080">$headers</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">Body </span><span style="color: #800080">$body</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">UseBasicParsing
    </span><span style="color: #0000FF">return</span><span style="color: #000000"> </span><span style="color: #800080">$response</span><span style="color: #000000">.StatusCode
} 


</span><span style="color: #008000">#</span><span style="color: #008000">////Main Section////</span><span style="color: #008000">
</span><span style="color: #000000">
</span><span style="color: #800080">$coreComponentClass</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> get</span><span style="color: #000000">-</span><span style="color: #000000">scomclass </span><span style="color: #000000">-</span><span style="color: #000000">name OperationsManager2016.Upgrade.CoreComponent
</span><span style="color: #800080">$coreComponents</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Get</span><span style="color: #000000">-</span><span style="color: #000000">SCOMClassInstance </span><span style="color: #000000">-</span><span style="color: #000000">class </span><span style="color: #800080">$coreComponentClass</span><span style="color: #000000">
</span><span style="color: #0000FF">foreach</span><span style="color: #000000"> (</span><span style="color: #800080">$coreComponent</span><span style="color: #000000"> </span><span style="color: #0000FF">in</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponents</span><span style="color: #000000">) {

</span><span style="color: #800080">$Hostname</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.Name
</span><span style="color: #800080">$ComponentVersion</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.'[OperationsManager2016.Upgrade.CoreComponent].ComponentVersion'.value
</span><span style="color: #800080">$Role</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.'[OperationsManager2016.Upgrade.CoreComponent].Role'.value
</span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.HealthState </span><span style="color: #008080">-ne</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
{</span><span style="color: #800080">$UpgradeState</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Not Upgraded</span><span style="color: #800000">&quot;</span><span style="color: #000000">}
</span><span style="color: #0000FF">else</span><span style="color: #000000">
{</span><span style="color: #800080">$UpgradeState</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">}
</span><span style="color: #800080">$IsAvailable</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.IsAvailable
</span><span style="color: #800080">$OMManagementGroupName</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.ManagementGroup
</span><span style="color: #800080">$FullName</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.FullName
</span><span style="color: #800080">$LastModified</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> (</span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.LastModified).ToString(</span><span style="color: #800000">&quot;</span><span style="color: #800000">yyyy-MM-ddThh:mm:ssZ</span><span style="color: #800000">&quot;</span><span style="color: #000000">);
</span><span style="color: #800080">$OMObjectId</span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.Id
</span><span style="color: #800080">$OMManagementGroupId</span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponent</span><span style="color: #000000">.ManagementGroupId
</span><span style="color: #800080">$AgentPatchList</span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">
</span><span style="color: #800080">$AgentManagement</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">
</span><span style="color: #800080">$coreComponentArray</span><span style="color: #000000"> </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">@</span><span style="color: #000000">{</span><span style="color: #800000">&quot;</span><span style="color: #800000">Hostname</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$Hostname</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">ComponentVersion</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$ComponentVersion</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">Role</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$Role</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">UpgradeState</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$UpgradeState</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">IsAvailable</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$IsAvailable</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">OMManagementGroupName</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$OMManagementGroupName</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">FullName</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$FullName</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">LastModified</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$LastModified</span><span style="color: #000000">;</span><span style="color: #800000">&quot;</span><span style="color: #800000">OMObjectId</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$OMObjectId</span><span style="color: #000000">;</span><span style="color: #800000">&quot;</span><span style="color: #800000">OMManagementGroupId</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$OMManagementGroupId</span><span style="color: #000000">;</span><span style="color: #800000">&quot;</span><span style="color: #800000">AgentPatchList</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$AgentPatchList</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">AgentManagement</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$AgentManagement</span><span style="color: #000000">.ToString()}
}


</span><span style="color: #800080">$agentClass</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> get</span><span style="color: #000000">-</span><span style="color: #000000">scomclass </span><span style="color: #000000">-</span><span style="color: #000000">Name Microsoft.SystemCenter.Agent
</span><span style="color: #800080">$Agents</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Get</span><span style="color: #000000">-</span><span style="color: #000000">SCOMClassInstance </span><span style="color: #000000">-</span><span style="color: #000000">class </span><span style="color: #800080">$agentClass</span><span style="color: #000000">
</span><span style="color: #0000FF">foreach</span><span style="color: #000000"> (</span><span style="color: #800080">$Agent</span><span style="color: #000000"> </span><span style="color: #0000FF">in</span><span style="color: #000000"> </span><span style="color: #800080">$Agents</span><span style="color: #000000">) {

</span><span style="color: #800080">$Hostname</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.Path
</span><span style="color: #800080">$ComponentVersion</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.'[Microsoft.SystemCenter.HealthService].Version'.value
</span><span style="color: #800080">$Role</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Agent</span><span style="color: #800000">&quot;</span><span style="color: #000000">
</span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$ComponentVersion</span><span style="color: #000000"> </span><span style="color: #008080">-gt</span><span style="color: #000000"> </span><span style="color: #000000">7.2</span><span style="color: #000000">)
{</span><span style="color: #800080">$UpgradeState</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Success</span><span style="color: #800000">&quot;</span><span style="color: #000000">}
</span><span style="color: #0000FF">else</span><span style="color: #000000">
{</span><span style="color: #800080">$UpgradeState</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Not Upgraded</span><span style="color: #800000">&quot;</span><span style="color: #000000">}
</span><span style="color: #800080">$IsAvailable</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.IsAvailable
</span><span style="color: #800080">$OMManagementGroupName</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.ManagementGroup
</span><span style="color: #800080">$FullName</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.FullName
</span><span style="color: #800080">$LastModified</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> (</span><span style="color: #800080">$Agent</span><span style="color: #000000">.LastModified).ToString(</span><span style="color: #800000">&quot;</span><span style="color: #800000">yyyy-MM-ddThh:mm:ssZ</span><span style="color: #800000">&quot;</span><span style="color: #000000">);
</span><span style="color: #800080">$OMObjectId</span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.Id
</span><span style="color: #800080">$OMManagementGroupId</span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.ManagementGroupId
</span><span style="color: #800080">$AgentPatchList</span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.'[Microsoft.SystemCenter.HealthService].PatchList'.value
</span><span style="color: #800080">$AgentInstallation</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$Agent</span><span style="color: #000000">.'[Microsoft.SystemCenter.HealthService].IsManuallyInstalled'.value
</span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$AgentInstallation</span><span style="color: #000000"> </span><span style="color: #008080">-eq</span><span style="color: #000000"> </span><span style="color: #0000FF">$True</span><span style="color: #000000">)
{</span><span style="color: #800080">$AgentManagement</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Manual</span><span style="color: #800000">&quot;</span><span style="color: #000000">}
</span><span style="color: #0000FF">else</span><span style="color: #000000">
{</span><span style="color: #800080">$AgentManagement</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Remote</span><span style="color: #800000">&quot;</span><span style="color: #000000">}
</span><span style="color: #800080">$agentCollectionArray</span><span style="color: #000000"> </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">@</span><span style="color: #000000">{</span><span style="color: #800000">&quot;</span><span style="color: #800000">Hostname</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$Hostname</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">ComponentVersion</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$ComponentVersion</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">Role</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$Role</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">UpgradeState</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$UpgradeState</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">IsAvailable</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$IsAvailable</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">OMManagementGroupName</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$OMManagementGroupName</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">FullName</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$FullName</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">LastModified</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$LastModified</span><span style="color: #000000">;</span><span style="color: #800000">&quot;</span><span style="color: #800000">OMObjectId</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$OMObjectId</span><span style="color: #000000">;</span><span style="color: #800000">&quot;</span><span style="color: #800000">OMManagementGroupId</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$OMManagementGroupId</span><span style="color: #000000">;</span><span style="color: #800000">&quot;</span><span style="color: #800000">AgentPatchList</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$AgentPatchList</span><span style="color: #000000">.ToString();</span><span style="color: #800000">&quot;</span><span style="color: #800000">AgentManagement</span><span style="color: #800000">&quot;</span><span style="color: #000000">=</span><span style="color: #800080">$AgentManagement</span><span style="color: #000000">.ToString()}
}

</span><span style="color: #800080">$coreComponentArrayJSON</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$coreComponentArray</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> ConvertTo</span><span style="color: #000000">-</span><span style="color: #000000">JSON
</span><span style="color: #008000">#</span><span style="color: #008000"> Submit the data to the API endpoint - for core components</span><span style="color: #008000">
</span><span style="color: #000000">Post</span><span style="color: #000000">-</span><span style="color: #000000">OMSData </span><span style="color: #000000">-</span><span style="color: #000000">customerId </span><span style="color: #800080">$customerId</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">sharedKey </span><span style="color: #800080">$sharedKey</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">body ([System.Text.Encoding]</span><span style="color: #000000">::</span><span style="color: #000000">UTF8.GetBytes(</span><span style="color: #800080">$coreComponentArrayJSON</span><span style="color: #000000">)) </span><span style="color: #000000">-</span><span style="color: #000000">logType </span><span style="color: #800080">$logType</span><span style="color: #000000">

</span><span style="color: #0000FF">If</span><span style="color: #000000">(</span><span style="color: #800080">$agentCollectionArray</span><span style="color: #000000">.count </span><span style="color: #008080">-lt</span><span style="color: #000000"> </span><span style="color: #000000">480</span><span style="color: #000000">)
{
</span><span style="color: #800080">$agentCollectionArrayJSON</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$agentCollectionArray</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> ConvertTo</span><span style="color: #000000">-</span><span style="color: #000000">JSON

</span><span style="color: #008000">#</span><span style="color: #008000"> Submit the data to the API endpoint - for agents</span><span style="color: #008000">
</span><span style="color: #000000">Post</span><span style="color: #000000">-</span><span style="color: #000000">OMSData </span><span style="color: #000000">-</span><span style="color: #000000">customerId </span><span style="color: #800080">$customerId</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">sharedKey </span><span style="color: #800080">$sharedKey</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">body ([System.Text.Encoding]</span><span style="color: #000000">::</span><span style="color: #000000">UTF8.GetBytes(</span><span style="color: #800080">$agentCollectionArrayJSON</span><span style="color: #000000">)) </span><span style="color: #000000">-</span><span style="color: #000000">logType </span><span style="color: #800080">$logType</span><span style="color: #000000">
}
</span><span style="color: #0000FF">else</span><span style="color: #000000">
{
    </span><span style="color: #800080">$indextracking</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">
    </span><span style="color: #0000FF">ForEach</span><span style="color: #000000">(</span><span style="color: #800080">$collectedAgentItem</span><span style="color: #000000"> </span><span style="color: #0000FF">in</span><span style="color: #000000"> </span><span style="color: #800080">$agentCollectionArray</span><span style="color: #000000">)
    {
        </span><span style="color: #008000">#</span><span style="color: #008000"> Submit the data to the API endpoint - for agents</span><span style="color: #008000">
</span><span style="color: #000000">        </span><span style="color: #800080">$collectedAgentItemFixed</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> ConvertTo</span><span style="color: #000000">-</span><span style="color: #000000">Json </span><span style="color: #000000">-</span><span style="color: #000000">InputObject </span><span style="color: #000000">@</span><span style="color: #000000">(</span><span style="color: #800080">$collectedAgentItem</span><span style="color: #000000">) 
        Post</span><span style="color: #000000">-</span><span style="color: #000000">OMSData </span><span style="color: #000000">-</span><span style="color: #000000">customerId </span><span style="color: #800080">$customerId</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">sharedKey </span><span style="color: #800080">$sharedKey</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">body ([System.Text.Encoding]</span><span style="color: #000000">::</span><span style="color: #000000">UTF8.GetBytes(</span><span style="color: #800080">$collectedAgentItemFixed</span><span style="color: #000000">)) </span><span style="color: #000000">-</span><span style="color: #000000">logType </span><span style="color: #800080">$logType</span><span style="color: #000000">

        </span><span style="color: #800080">$indextracking</span><span style="color: #000000">++</span><span style="color: #000000">

   }
}</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p><br>If successful, the upgrade state data collected by the HTTP Collector API should appear in the OMS Upgrade Helper Dashboard in the targeted OMS Workspace within a few minutes.<br><br>To list all records of the <strong>OM16UpgradeState</strong> type that were successfully sent to the targeted workspace, run the <em><strong>Type=OM16UpgradeState_CL</strong></em> search query. The records returned from the search result should appear as follows with the field data types identified accordingly as indicated by their suffix:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1095.png" width="478" height="479">&nbsp;<br><br><br>The search queries used to power each of the Views within the Upgrade Helper Dashboard will filter these records to summarize and display them accordingly as show in the following example:<br><br><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;border-left: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1098.png" width="1088" height="448">&nbsp; <br><br><br>The <strong>tooltip</strong> <strong>feature</strong> displays the full name when hovering the pointer above the line item in the List view.<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1097.png" width="423" height="375">&nbsp;<br><br><br><br>Here are the queries for each visualization and navigation component of each View in the Upgrade Helper Dashboard above:</p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:de384791-b8b1-4e5b-a681-8e5b0c5eebdb" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1043px;height: 658px;background-color:White;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #008000">#</span><span style="color: #008000">#Upgrade State of Core Components</span><span style="color: #008000">
#</span><span style="color: #008000">Donut Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">OM16UpgradeState_CL Role_s</span><span style="color: #000000">!=</span><span style="color: #000000">Agent</span><span style="color: #000000">|</span><span style="color: #000000"> measure count() by UpgradeState_s
</span><span style="color: #008000">#</span><span style="color: #008000">List Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">OM16UpgradeState_CL Role_s</span><span style="color: #000000">!=</span><span style="color: #000000">Agent </span><span style="color: #000000">|</span><span style="color: #000000"> Measure Countdistinct(Hostname_s) by Hostname_s, UpgradeState_s, Role_s
</span><span style="color: #008000">#</span><span style="color: #008000">Navigation Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">OM16UpgradeState_CL Role_s</span><span style="color: #000000">!=</span><span style="color: #000000">Agent

</span><span style="color: #008000">#</span><span style="color: #008000">#Upgrade State of Agents</span><span style="color: #008000">
#</span><span style="color: #008000">Donut Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">OM16UpgradeState_CL Role_s</span><span style="color: #000000">=</span><span style="color: #000000">Agent </span><span style="color: #000000">|</span><span style="color: #000000"> measure count() by UpgradeState_s
</span><span style="color: #008000">#</span><span style="color: #008000">List Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">OM16UpgradeState_CL Role_s</span><span style="color: #000000">=</span><span style="color: #000000">Agent UpgradeState_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Not Upgraded</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> Measure Countdistinct(Hostname_s) by Hostname_s, ComponentVersion_s
</span><span style="color: #008000">#</span><span style="color: #008000">Navigation Query</span><span style="color: #008000">
</span><span style="color: #800000">&quot;</span><span style="color: #800000">Type=OM16UpgradeState_CL Role_s=Agent UpgradeState_s=</span><span style="color: #800000">&quot;</span><span style="color: #000000">Not Upgraded</span><span style="color: #800000">&quot;</span><span style="color: #800000">

##SCOM Agent Patch List
#Number Tile Query
Type=OM16UpgradeState_CL Role_s=Agent
#List Query
Type=OM16UpgradeState_CL Role_s=Agent | Measure Count() by  AgentPatchList_s
#Navigation Query
Type=OM16UpgradeState_CL Role_s=Agent</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>
<p><br><br><br><strong><br>Additional Resources:</strong> </p>
<p>Log Analytics HTTP Data Collector API by Brian Wren<br><a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/" target="_blank">https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/</a> 
<p>HTTP Data Collector API: Send us data from space… or anywhere! by Evan Hissey<br><a href="https://blogs.technet.microsoft.com/msoms/2016/08/30/http-data-collector-api-send-us-data-from-space-or-anywhere/" target="_blank">https://blogs.technet.microsoft.com/msoms/2016/08/30/http-data-collector-api-send-us-data-from-space-or-anywhere/</a> 
<p>OMS View Designer: Visualize your data your way by Evan Hissey <br><a title="https://blogs.technet.microsoft.com/msoms/2016/06/30/oms-view-designer-visualize-your-data-your-way/" href="https://blogs.technet.microsoft.com/msoms/2016/06/30/oms-view-designer-visualize-your-data-your-way/" target="_blank">https://blogs.technet.microsoft.com/msoms/2016/06/30/oms-view-designer-visualize-your-data-your-way/</a> 
<p><em><font size="3" face="Arial"><br></font></em>&nbsp;</p>
<p><br><em><font size="3" face="Arial">&nbsp; <br></font></em><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.<br><br></font></p>]]></content:encoded>
    </item>
    <item>
      <title>FIXED in UR11 OM12R2: 3-State Monitor Not Triggering New Notifications When Changing Between Degraded States</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/fixed-in-ur11-om12r2-3-state-monitor-not-triggering-new-notifications-when-changing-between-degraded-states</link>
      <pubDate>Fri, 28 Oct 2016 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=4066</guid>
      <description><![CDATA[This post demonstrates how we can use a simple test case to verify whether the issue involving...]]></description>
      <content:encoded><![CDATA[<p>This post demonstrates how we can use a simple test case to verify whether the issue involving <strong><font size="3">3-state unit monitors not triggering new alert notifications when changing from Warning to Critical or vice versa</font></strong>, still persist in an <strong>OpsMgr 2012 R2</strong> management group patched with <strong>Update Rollup 11 (UR11) (KB3183990)</strong>.<br><br>While I was going through the list of issues fixed in <a href="https://support.microsoft.com/en-us/kb/3183990" target="_blank">Update Rollup 11 for System Center 2012 R2 Operations Manager</a> with my business counterpart, Dimi Doumtsis, there was 1 fix in particular that caught our attention: <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1080.png" width="901" height="124"> <br><br>This issue has been around since the OpsMgr 2007 SP1 days, where a 3-state unit monitor would change state from Healthy to Warning and trigger an alert notification when the first warning threshold is breached, but when the critical threshold is breached later and changes the health state of the unit monitor from Warning to Critical, it does not trigger another alert notification. <br>Over the years, this issue has affected alot of OpsMgr users and caused a fair amount of support cases to be logged, where the 3-state monitor they configured (<em>Severity: Matches monitor’s health</em>) failed to trigger an alert notification for a critical situation that requires their immediate attention&nbsp; - for example, when the % free space of a logical disk on a critical server dropped from 10% (Warning) to 1% (Critical).<br>The easy fix was to create two 2-state unit monitors instead, one with the critical threshold and the other with the warning threshold. That way, the user would receive an alert notification from the 2-state monitor with the critical threshold when it’s threshold is breached, but will also receive another alert from the 2-state monitor with the warning threshold as well. <br><br>But<strong> Finally</strong>, the fix for this long persisting issue is available in Update Rollup 11 for OpsMgr 2012 R2, and can be downloaded from the <a href="https://catalog.update.microsoft.com/v7/site/Search.aspx?q=3183990" target="_blank">update catalog site</a> to be applied to an OpsMgr 2012 R2 management group.<br><br>To verify the fix after applying UR11 to an OpsMgr 2012 R2 management group, here is a simple test case that can be setup in two steps:</p> <ol> <li>Configure a 3-state VBscript-based unit monitor and force the state changes to trigger alerts,  <li>Configure a notification subscription scoped to the 3-state unit monitor from (1.) with a command notification channel to simulate a notification by writing the alert information to a text file whenever a new alert is generated by the 3-state monitor.</li></ol> <p><br><strong>Step 1: To Configure the 3-state VBscript-based unit monitor:<br><br></strong>Create a 3-state unit monitor using the <strong>Timed Script Three State Monitor </strong>type, target the <strong>RMS Emulator </strong>class and configure it to run at a 5 minute interval.</p> <p><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1081.png" width="1045" height="519">&nbsp;<br><br><br>Paste the following VBscript in the <strong>Script</strong> field of the <strong>Script</strong> page and give a name like <em>MyTestScript.vbs </em>to the script in the <strong>File Name </strong>field:</p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:07d6726b-c3cd-470d-8131-e05b05996036" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 545px;height: 338px;background-color:White;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #008000">'</span><span style="color: #008000">Returns: State = &quot;Green&quot;</span><span style="color: #008000">
'</span><span style="color: #008000">SCOM Parameter Name: Property[@Name='SetState']</span><span style="color: #008000">
'</span><span style="color: #008000">Healthy: Equals &quot;Green&quot;</span><span style="color: #008000">
'</span><span style="color: #008000">Warning: Equals &quot;Yellow&quot; </span><span style="color: #008000">
'</span><span style="color: #008000">Critical: Equals &quot;Red&quot; </span><span style="color: #008000">
</span><span style="color: #000000">
    </span><span style="color: #0000FF">Dim</span><span style="color: #000000"> oAPI, propertyBag
    </span><span style="color: #0000FF">Set</span><span style="color: #000000"> oAPI </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000FF">CreateObject</span><span style="color: #000000">(</span><span style="color: #800000">&quot;</span><span style="color: #800000">MOM.ScriptAPI</span><span style="color: #800000">&quot;</span><span style="color: #000000">)    
    </span><span style="color: #0000FF">Set</span><span style="color: #000000"> propertyBag </span><span style="color: #000000">=</span><span style="color: #000000"> oAPI.CreatePropertyBag()

</span><span style="color: #0000FF">Call</span><span style="color: #000000"> propertyBag.AddValue (</span><span style="color: #800000">&quot;</span><span style="color: #800000">SetState</span><span style="color: #800000">&quot;</span><span style="color: #000000">, </span><span style="color: #800000">&quot;</span><span style="color: #800000">Green</span><span style="color: #800000">&quot;</span><span style="color: #000000">) 

</span><span style="color: #0000FF">Call</span><span style="color: #000000"> oAPI.Return(propertyBag) 
</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><br>To control the state of this unit monitor, just change the value of the “SetState” key in the propertyBag.AddValue method of the VBscript –&gt; “<strong>Red</strong>” for a Critical state, “<strong>Yellow</strong>“ for a Warning state and “<strong>Green”</strong> for a Healthy State.<br><a href="https://msdnshared.blob.core.windows.net/media/2016/10/image1082.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image_thumb934.png" width="395" height="36"></a>&nbsp;<br><br><br>Map the <strong>SetState </strong>parameter -&nbsp; <em><strong>Property[@Name='SetState'] – </strong></em>to the values (<em>Red, Yellow, Green</em>) for the <strong>Unhealthy, Degraded </strong>and <strong>Healthy Expressions </strong>as follows:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1083.png" width="1104" height="530">&nbsp;<br><br><br>Enable alerting for the 3-state unit monitor with the following settings:<br><strong>- Generate an alert when: The monitor is in a critical or warning health state</strong><br><strong>- Severity: Match monitor’s health</strong><br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1084.png" width="625" height="401">&nbsp; <br><br><br><br>
<p><strong>Step 2: To Configure the notification subscription with command notification channel:</strong><br><br>Follow the steps on <a href="https://blogs.technet.microsoft.com/fesiro/2012/11/26/how-to-configure-command-notification-in-scom-2012-with-powershell-script/" target="_blank">How to Configure Command Notification in SCOM 2012 with PowerShell script</a> by fesiro for the notification channel and subscriber:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1085.png" width="1074" height="405">&nbsp;<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1086.png" width="1087" height="388">&nbsp;<br><br><br><br>Create a new notification subscription and scope it to the 3-state unit monitor, <strong>New(0)</strong> resolution state for it’s alerts and the command notification channel and subscriber created earlier:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1087.png" width="1197" height="498">&nbsp; <br><br><br><br>&nbsp; <br><strong><u>Test Results:</u></strong> <br><br></p>
<ol>
<li>On an OpsMgr 2012 R2 management group patched with only <strong>Update Rollup 7</strong> (7.1.10226.<strong>1090</strong>), the test returned a <strong>NEGATIVE</strong> result as the <strong>issue still persist</strong> where the state changes in the 3-state unit monitor from Warning to Critical or Critical to Warning did not trigger a simulated notification by writing the alert information to the <strong>LogAlerts</strong> log file:<br><strong><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1088.png" width="1238" height="272"><br><br><br></strong>
<li>However, on an OpsMgr 2012 R2 management group patched with <strong>Update Rollup 11</strong> (7.1.10226.<strong>1239</strong>), the test returned a <strong>POSITIVE</strong> result as every state change in the 3-state unit monitor from Warning to Critical or Critical to Warning triggered a simulated notification by writing the alert information to the <strong>LogAlerts</strong> log file:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1089.png" width="1181" height="224"><br><br>The <strong>severity</strong> of the alert generated by the 3-state unit monitor was also updated accordingly with every state change from Warning to Critical or Critical to Warning:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image1090.png" width="957" height="297"><br><br><strong>Housekeeping</strong>: After completing the test, <strong>delete</strong> the management pack with the VBScript-based 3-state unit monitor and <strong>delete</strong> the notification subscription, channel and subscriber used for the test case.</li></ol>
<p><br><br><br><br>The test results above showed that this long persisting issue is <strong>FINALLY</strong> fixed in <strong>Update Rollup 11</strong> for OpsMgr 2012 R2. Well, better late than never! :-)</p><strong>
<p><br><br><br></strong><br>&nbsp;<br><br><strong>Additional Resources:</strong> </p>
<p>UR11 for SCOM 2012 R2 – Step by Step by Kevin Holman<br><a title="https://blogs.technet.microsoft.com/kevinholman/2016/09/06/ur11-for-scom-2012-r2-step-by-step/" href="https://blogs.technet.microsoft.com/kevinholman/2016/09/06/ur11-for-scom-2012-r2-step-by-step/" target="_blank">https://blogs.technet.microsoft.com/kevinholman/2016/09/06/ur11-for-scom-2012-r2-step-by-step/</a> 
<p><em><font size="3" face="Arial"><br></font></em>&nbsp;<br></p>
<p><br><em><font size="3" face="Arial">&nbsp; <br></font></em><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Injecting Simulated Records for the Change Tracking Solution into an OMS Workspace</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/injecting-simulated-records-for-the-change-tracking-solution-into-an-oms-workspace</link>
      <pubDate>Mon, 17 Oct 2016 08:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=3315</guid>
      <description><![CDATA[In this post, we look at how we can leverage the OMS HTTP Collector API to introduce a Custom Log...]]></description>
      <content:encoded><![CDATA[<p><br>In this post, we look at how we can leverage the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/" target="_blank">OMS HTTP Collector API</a> to introduce a <strong>Custom Log Type</strong> that simulates the record type of the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-change-tracking/" target="_blank">Change Tracking Solution</a> – <strong>ConfigurationChange</strong>, and injecting sample records for it into an OMS Workspace. With the right set of sample data and the right search queries adapted from the ones used to power the visualization of the Change Tracking Solution, <em>a simulated search and visualization result</em> can be reconstructed in any OMS Workspace for exploratory purposes. However, there are some views and dashboards with rich data visualization and contextual search capabilities used in some OMS Solutions that cannot be recreated with the <a href="https://blogs.technet.microsoft.com/msoms/2016/06/30/oms-view-designer-visualize-your-data-your-way/" target="_blank">View Designer</a> at this time. These capabilities are only available and packaged with specific OMS Solutions in order to provide deeper insights pivoted around the problem areas they address. <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/11/image80.png" width="383" height="213"> <br><br><br><strong><font color="#ff0000">Important Note:</font></strong> <br><strong>This simulation method should only be used in <u>test environments for demo or POC purposes</u> as sample data SHOULD NOT be injected into a production environment and be mixed with live production data.</strong></p> <p><strong><br></strong>The OMS <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-change-tracking/" target="_blank">Change Tracking Solution</a> can be used to identify software and Windows Services changes and Linux daemon changes that occur in your environment and help pinpoint operational issues. Changes to installed software and Windows services on the monitored servers are read and then the data is sent to an OMS Workspace by the OMS Agent for processing. Logic is applied to the received data and the cloud service records the data of type <strong>ConfigurationChange</strong>. When changes are found, servers with changes are shown in the Change Tracking dashboard. Here is an example of an <strong>ConfigurationChange </strong>type record:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/09/image518.png" width="399" height="460">&nbsp;<br><br>There are 2 types of <strong>fields</strong> for this record type:</p> <ul> <li><strong>Type 1 Fields: Common fields</strong>:  <ul> <li>SourceSystem  <li>MG  <li>id  <li>Type  <li>ManagementGroupName</li></ul> <li><strong>Type 2 Fields: Solution level fields</strong>:  <ul> <li>TimeGenerated&nbsp; <li>Computer  <li>SourceComputerId  <li>ConfigChangeType  <li>ChangeCategory  <li>SvcChangeType  <li>SvcDisplayName  <li>SvcName  <li>SvcState  <li>SvcPreviousState  <li>SvcStartupType  <li>SvcAccount  <li>SvcPath  <li>SoftwareType  <li>SoftwareName  <li>Previous  <li>Current  <li>Publisher  <li>SvcPreviousStartupType  <li>SvcPreviousPath</li></ul></li></ul> <p><br>Lets name the <strong>Custom Log Type</strong> that we are creating to simulate the <strong>ConfigurationChange</strong>, record type as <strong><u>MyConfigurationChange</u></strong>.<br>Since the values for the <strong>Type 1 fields</strong> are automatically assigned to <strong>ALL</strong> records upon ingestion by the OMS Service, the sample records of type <strong>MyConfigurationChange </strong>will have most of these fields populated as well. Hence only the <strong>Type 2 fields</strong> and their corresponding sample values are required to be added into the JSON payload for <strong>MyConfigurationChange </strong>records to be injected into an OMS Workspace of interest.<br><br>Here is a sample PowerShell script that converts a CSV file with sample <strong>ConfigurationChange </strong>type data into JSON data and injecting it into an OMS Workspace with the <strong>Log Analytics HTTP Data Collector API </strong>in a JSON payload. The sample data will appear as records of type <strong><strong>MyConfigurationChange</strong>_CL </strong>in the targeted OMS Workspace.<br><br><br>This PowerShell script consist of 4 main parts:<br><br><strong>Part 1: Specify the key information for authentication, custom log type name and record time stamp.</strong> <br><strong>Note:</strong> The <em>MyTimeGenerated </em>field holds the timestamp for the records in the CSV file and is assigned to $TimeStampField variable so that the records injected will have the same create time as their timestamp value in the <em>MyTimeGenerated </em>field once in the OMS Workspace.</p> <div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:7faac0b9-687a-4181-a5e7-30cd7b90a10d" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 864px;height: 220px;background-color:#FFFFD7;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #008000">#</span><span style="color: #008000"> Replace with your Workspace ID</span><span style="color: #008000">
</span><span style="color: #800080">$CustomerId</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</span><span style="color: #800000">&quot;</span><span style="color: #000000"> 
 
</span><span style="color: #008000">#</span><span style="color: #008000"> Replace with your Primary Key</span><span style="color: #008000">
</span><span style="color: #800080">$SharedKey</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span><span style="color: #800000">&quot;</span><span style="color: #000000">
 
</span><span style="color: #008000">#</span><span style="color: #008000">Specify the name of the record type that we'll be creating.</span><span style="color: #008000">
</span><span style="color: #800080">$LogType</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">MyConfigurationChange</span><span style="color: #800000">&quot;</span><span style="color: #000000">
 
</span><span style="color: #008000">#</span><span style="color: #008000">Specify a time in the format YYYY-MM-DDThh:mm:ssZ to specify a created time for the records.</span><span style="color: #008000">
</span><span style="color: #800080">$TimeStampField</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">MyTimeGenerated</span><span style="color: #800000">&quot;</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><strong><br>Part 2: Prepare the standard functions to create the authorization signature, and to create and post the request</strong> (Copied from the snippets provided in the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/" target="_blank">standard API Documentation</a>): 
<p></p>
<p></p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:be2b03d3-a17c-494c-89a5-606c2ccbf40e" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 861px;height: 515px;background-color:#FFFFD7;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #008000">#</span><span style="color: #008000"> Function to create the authorization signature.</span><span style="color: #008000">
</span><span style="color: #0000FF">Function</span><span style="color: #000000"> Build</span><span style="color: #000000">-</span><span style="color: #000000">Signature (</span><span style="color: #800080">$customerId</span><span style="color: #000000">, </span><span style="color: #800080">$sharedKey</span><span style="color: #000000">, </span><span style="color: #800080">$date</span><span style="color: #000000">, </span><span style="color: #800080">$contentLength</span><span style="color: #000000">, </span><span style="color: #800080">$method</span><span style="color: #000000">, </span><span style="color: #800080">$contentType</span><span style="color: #000000">, </span><span style="color: #800080">$resource</span><span style="color: #000000">)
{
    </span><span style="color: #800080">$xHeaders</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">x-ms-date:</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$date</span><span style="color: #000000">
    </span><span style="color: #800080">$stringToHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$method</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$contentLength</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$contentType</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$xHeaders</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">`n</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$resource</span><span style="color: #000000">

    </span><span style="color: #800080">$bytesToHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Text.Encoding]</span><span style="color: #000000">::</span><span style="color: #000000">UTF8.GetBytes(</span><span style="color: #800080">$stringToHash</span><span style="color: #000000">)
    </span><span style="color: #800080">$keyBytes</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Convert]</span><span style="color: #000000">::</span><span style="color: #000000">FromBase64String(</span><span style="color: #800080">$sharedKey</span><span style="color: #000000">)

    </span><span style="color: #800080">$sha256</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> New</span><span style="color: #000000">-</span><span style="color: #000000">Object System.Security.Cryptography.HMACSHA256
    </span><span style="color: #800080">$sha256</span><span style="color: #000000">.Key </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$keyBytes</span><span style="color: #000000">
    </span><span style="color: #800080">$calculatedHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$sha256</span><span style="color: #000000">.ComputeHash(</span><span style="color: #800080">$bytesToHash</span><span style="color: #000000">)
    </span><span style="color: #800080">$encodedHash</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [Convert]</span><span style="color: #000000">::</span><span style="color: #000000">ToBase64String(</span><span style="color: #800080">$calculatedHash</span><span style="color: #000000">)
    </span><span style="color: #800080">$authorization</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> 'SharedKey {</span><span style="color: #000000">0</span><span style="color: #000000">}:{</span><span style="color: #000000">1</span><span style="color: #000000">}' </span><span style="color: #008080">-f</span><span style="color: #000000"> </span><span style="color: #800080">$customerId</span><span style="color: #000000">,</span><span style="color: #800080">$encodedHash</span><span style="color: #000000">
    </span><span style="color: #0000FF">return</span><span style="color: #000000"> </span><span style="color: #800080">$authorization</span><span style="color: #000000">
}

</span><span style="color: #008000">#</span><span style="color: #008000"> Function to create and post the request</span><span style="color: #008000">
</span><span style="color: #0000FF">Function</span><span style="color: #000000"> Post</span><span style="color: #000000">-</span><span style="color: #000000">OMSData(</span><span style="color: #800080">$customerId</span><span style="color: #000000">, </span><span style="color: #800080">$sharedKey</span><span style="color: #000000">, </span><span style="color: #800080">$body</span><span style="color: #000000">, </span><span style="color: #800080">$logType</span><span style="color: #000000">) 
{
    </span><span style="color: #800080">$method</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">POST</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    </span><span style="color: #800080">$contentType</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">application/json</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    </span><span style="color: #800080">$resource</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">/api/logs</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    </span><span style="color: #800080">$rfc1123date</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> [DateTime]</span><span style="color: #000000">::</span><span style="color: #000000">UtcNow.ToString(</span><span style="color: #800000">&quot;</span><span style="color: #800000">r</span><span style="color: #800000">&quot;</span><span style="color: #000000">)
    </span><span style="color: #800080">$contentLength</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$body</span><span style="color: #000000">.Length
     </span><span style="color: #800080">$signature</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Build</span><span style="color: #000000">-</span><span style="color: #000000">Signature `
        </span><span style="color: #000000">-</span><span style="color: #000000">customerId </span><span style="color: #800080">$customerId</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">sharedKey </span><span style="color: #800080">$sharedKey</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">date </span><span style="color: #800080">$rfc1123date</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">contentLength </span><span style="color: #800080">$contentLength</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">fileName </span><span style="color: #800080">$fileName</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">method </span><span style="color: #800080">$method</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">contentType </span><span style="color: #800080">$contentType</span><span style="color: #000000"> `
        </span><span style="color: #000000">-</span><span style="color: #000000">resource </span><span style="color: #800080">$resource</span><span style="color: #000000">
    </span><span style="color: #800080">$uri</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">https://</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$customerId</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">.ods.opinsights.azure.com</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800080">$resource</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">?api-version=2016-04-01</span><span style="color: #800000">&quot;</span><span style="color: #000000">

    </span><span style="color: #800080">$headers</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">@</span><span style="color: #000000">{
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Authorization</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$signature</span><span style="color: #000000">;
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Log-Type</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$logType</span><span style="color: #000000">;
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">x-ms-date</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$rfc1123date</span><span style="color: #000000">;
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">time-generated-field</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800080">$TimeStampField</span><span style="color: #000000">;
    }

    </span><span style="color: #800080">$response</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Invoke</span><span style="color: #000000">-</span><span style="color: #000000">WebRequest </span><span style="color: #000000">-</span><span style="color: #000000">Uri </span><span style="color: #800080">$uri</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">Method </span><span style="color: #800080">$method</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">ContentType </span><span style="color: #800080">$contentType</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">Headers </span><span style="color: #800080">$headers</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">Body </span><span style="color: #800080">$body</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">UseBasicParsing
    </span><span style="color: #0000FF">return</span><span style="color: #000000"> </span><span style="color: #800080">$response</span><span style="color: #000000">.StatusCode
}
</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><strong><br>Part 3: Convert CSV data to JSON payload and convert data to correct type.<br></strong>Note that the <strong>HTTP Data Collector API</strong> automatically determines the data type of the custom fields for the Custom Log Type based on their values in the JSON payload. For more information on record types and properties, refer to the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/" target="_blank">API Documentation</a>.<br>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:9e679dc6-b122-4e34-ab8d-fc4bcbfe68db" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1011px;height: 151px;background-color:#FFFFD7;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #800080">$ConfigurationChangeData</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> Import</span><span style="color: #000000">-</span><span style="color: #000000">Csv </span><span style="color: #000000">-</span><span style="color: #000000">Path &lt;&lt;Path\SampleConfigurationChangeData.csv</span><span style="color: #000000">&gt;&gt;</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> select MyTimeGenerated,Computer,SourceComputerId,ConfigChangeType,ChangeCategory,SvcChangeType,SvcDisplayName,SvcName,SvcState,SvcPreviousState,SvcStartupType,SvcAccount,SvcPath,SoftwareType,SoftwareName,Previous,Current,Publisher,SvcPreviousStartupType,SvcPreviousPath</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><br>The fields selected for the custom <strong>MyConfigurationChange </strong>record type in order to simulate Change Tracking Solution records in an OMS Workspace are:<u><br></u><strong>MyTimeGenerated</strong> , Computer, SourceComputerId, ConfigChangeType, ChangeCategory, SvcChangeType, SvcDisplayName, SvcName, SvcState, SvcPreviousState, SvcStartupType, SvcAccount, SvcPath, SoftwareType, SoftwareName, Previous, Current, Publisher, SvcPreviousStartupType,SvcPreviousPath<br><br>Here is an example of a sample record imported from the CSV file and converted to JSON format to be submitted to the HTTP Data Collector API:<br>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:389a8604-8d29-4484-9997-8075669f7a19" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 867px;height: 395px;background-color:White;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000">{
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">MyTimeGenerated</span><span style="color: #800000">&quot;</span><span style="color: #000000">: </span><span style="color: #800000">&quot;</span><span style="color: #800000">2016-10-18T20:05:12.07Z</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Computer</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">MyComputer.contoso.com</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SourceComputerId</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">805ca53d-1a02-be85-e10c-4b4f32f2f2ac</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">ConfigChangeType</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">WindowsServices</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">ChangeCategory</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">Modified</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcChangeType</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">State</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcDisplayName</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">Microsoft Storage Spaces SMP</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcName</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">smphost</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcState</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">Running</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcPreviousState</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">Stopped</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcStartupType</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">Manual</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcAccount</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">NT AUTHORITY\\NetworkService</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcPath</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;</span><span style="color: #800000">C:\\Windows\\System32\\svchost.exe -k smphost</span><span style="color: #800000">&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SoftwareType</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SoftwareName</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Previous</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Current</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">Publisher</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcPreviousStartupType</span><span style="color: #800000">&quot;</span><span style="color: #000000">:  </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">,
        </span><span style="color: #800000">&quot;</span><span style="color: #800000">SvcPreviousPath</span><span style="color: #800000">&quot;</span><span style="color: #000000">: </span><span style="color: #800000">&quot;&quot;</span><span style="color: #000000">
},
</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><br>
<p><strong>Part 4: Submit the data to the API endpoint.<br></p></strong>
<p></p>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:520864b0-b8c6-4333-887f-7e6456f3ffe4" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 935px;height: 226px;background-color:#FFFFD7;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #0000FF">ForEach</span><span style="color: #000000">(</span><span style="color: #800080">$ConfigurationChangeSingleRecord</span><span style="color: #000000"> </span><span style="color: #0000FF">in</span><span style="color: #000000"> </span><span style="color: #800080">$ConfigurationChangeData</span><span style="color: #000000">)
{
  </span><span style="color: #800080">$ConfigurationChangeSingleRecordFixed</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> ConvertTo</span><span style="color: #000000">-</span><span style="color: #000000">Json </span><span style="color: #000000">-</span><span style="color: #000000">InputObject </span><span style="color: #000000">@</span><span style="color: #000000">(</span><span style="color: #800080">$ConfigurationChangeSingleRecord</span><span style="color: #000000">) 
  </span><span style="color: #008000">#</span><span style="color: #008000"> Submit the data to the API endpoint</span><span style="color: #008000">
</span><span style="color: #000000">Post</span><span style="color: #000000">-</span><span style="color: #000000">OMSData </span><span style="color: #000000">-</span><span style="color: #000000">customerId </span><span style="color: #800080">$customerId</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">sharedKey </span><span style="color: #800080">$sharedKey</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">body ([System.Text.Encoding]</span><span style="color: #000000">::</span><span style="color: #000000">UTF8.GetBytes(</span><span style="color: #800080">$ConfigurationChangeSingleRecordFixed</span><span style="color: #000000">)) </span><span style="color: #000000">-</span><span style="color: #000000">logType </span><span style="color: #800080">$logType</span><span style="color: #000000">
}</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><br>So, if <strong>Part 1 + Part 2 + Part 3 + Part 4</strong> of the sample PowerShell script returns <strong>Status Code of 202 </strong>for each record, it means that the JSON Payload has been accepted by the HTTP Data Collector API and the simulated records should appear in the targeted OMS Workspace within a few minutes time.<br>To list all records of the <strong>MyConfigurationChange </strong>type that were successfully injected into a targeted workspace, run the <em><strong>Type=<strong>MyConfigurationChange</strong>_CL</strong> s</em>earch query. The records returned from the search result should appear as follows with the field data types identified accordingly as indicated by their suffix:<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/11/image81.png" width="545" height="469"> <br><br><br>With these sample records, we can view all recommendations using the OMS log search, correlate them with other existing record types, or create custom views and dashboards of a simulated Change Tracking Solution. Here is an example of a dashboard created with the View Designer using log search queries adapted from the actual <strong><a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-change-tracking/" target="_blank">Change Tracking Solution</a></strong>:<br>&nbsp; <img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/11/image82.png" width="1271" height="477"> <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/11/image83.png" width="1064" height="452">&nbsp;<br><br><br>Here are the queries for each visualization and navigation component of each View in the dashboard above: <br>
<div id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:676ce0ca-00b0-46d3-85b9-be07ac89b3e2" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px"><pre style="width: 1048px;height: 605px;background-color:#CCE6FF;overflow: auto"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #008000">#</span><span style="color: #008000">#Configuration Changes Summary</span><span style="color: #008000">
#</span><span style="color: #008000">WindowsServices Chart Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">WindowsServices</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> Measure count() by ConfigChangeType_s
</span><span style="color: #008000">#</span><span style="color: #008000">Software Chart Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Software</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> Measure count() by ConfigChangeType_s
</span><span style="color: #008000">#</span><span style="color: #008000">Other Configuration Changes (Files or Daemons) Chart Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ConfigChangeType_s</span><span style="color: #000000">!=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Software</span><span style="color: #800000">&quot;</span><span style="color: #000000"> ConfigChangeType_s</span><span style="color: #000000">!=</span><span style="color: #800000">&quot;</span><span style="color: #800000">WindowsServices</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> Measure count() by ConfigChangeType_s

</span><span style="color: #008000">#</span><span style="color: #008000">#Changes by Condiguration Type</span><span style="color: #008000">
#</span><span style="color: #008000">Trend1 Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL (ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">WindowsServices AND SvcChangeType_s</span><span style="color: #000000">!=</span><span style="color: #000000">State AND NOT (SvcName_s</span><span style="color: #000000">=</span><span style="color: #000000">BITS AND SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">StartupType))
</span><span style="color: #008000">#</span><span style="color: #008000">Trend2 Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL (ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Software AND NOT (SoftwareName_s</span><span style="color: #000000">=*</span><span style="color: #000000">KB2461484</span><span style="color: #000000">*</span><span style="color: #000000"> OR SoftwareName_s</span><span style="color: #000000">=*</span><span style="color: #000000">KB2267602</span><span style="color: #000000">*</span><span style="color: #000000">))
</span><span style="color: #008000">#</span><span style="color: #008000">List Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ((ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">WindowsServices AND SvcChangeType_s</span><span style="color: #000000">!=</span><span style="color: #000000">State AND NOT (SvcName_s</span><span style="color: #000000">=</span><span style="color: #000000">BITS AND SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">StartupType)) OR (ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Software AND NOT (SoftwareName_s</span><span style="color: #000000">=*</span><span style="color: #000000">KB2461484</span><span style="color: #000000">*</span><span style="color: #000000"> OR SoftwareName_s</span><span style="color: #000000">=*</span><span style="color: #000000">KB2267602</span><span style="color: #000000">*</span><span style="color: #000000">)) OR (ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Daemons AND (SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">StartupType OR SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Path OR SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Runlevels)) OR ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Files) </span><span style="color: #000000">|</span><span style="color: #000000"> measure count() as Count by ConfigChangeType_s
</span><span style="color: #008000">#</span><span style="color: #008000">Navigation Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ((ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">WindowsServices AND SvcChangeType_s</span><span style="color: #000000">!=</span><span style="color: #000000">State AND NOT (SvcName_s</span><span style="color: #000000">=</span><span style="color: #000000">BITS AND SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">StartupType)) OR (ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Software AND NOT (SoftwareName_s</span><span style="color: #000000">=*</span><span style="color: #000000">KB2461484</span><span style="color: #000000">*</span><span style="color: #000000"> OR SoftwareName_s</span><span style="color: #000000">=*</span><span style="color: #000000">KB2267602</span><span style="color: #000000">*</span><span style="color: #000000">)) OR (ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Daemons AND (SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">StartupType OR SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Path OR SvcChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Runlevels)) OR ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #000000">Files) </span><span style="color: #000000">|</span><span style="color: #000000"> measure count() as Count by ConfigChangeType_s

</span><span style="color: #008000">#</span><span style="color: #008000">#Total Application and Package Changes</span><span style="color: #008000">
#</span><span style="color: #008000">First Number Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Software</span><span style="color: #800000">&quot;</span><span style="color: #000000"> SoftwareType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Application</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> Measure count() by SoftwareName_s
</span><span style="color: #008000">#</span><span style="color: #008000">Second Number Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Software</span><span style="color: #800000">&quot;</span><span style="color: #000000"> SoftwareType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Package</span><span style="color: #800000">&quot;</span><span style="color: #000000"> </span><span style="color: #000000">|</span><span style="color: #000000"> Measure count() by SoftwareName_s
</span><span style="color: #008000">#</span><span style="color: #008000">List Query</span><span style="color: #008000">
</span><span style="color: #000000">Type</span><span style="color: #000000">=</span><span style="color: #000000">MyConfigurationChange_CL ConfigChangeType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Software</span><span style="color: #800000">&quot;</span><span style="color: #000000"> (SoftwareType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Package</span><span style="color: #800000">&quot;</span><span style="color: #000000"> OR SoftwareType_s</span><span style="color: #000000">=</span><span style="color: #800000">&quot;</span><span style="color: #800000">Application</span><span style="color: #800000">&quot;</span><span style="color: #000000">) </span><span style="color: #000000">|</span><span style="color: #000000"> Measure count() by SoftwareType_s</span><span style="color: #800000">&quot;</span><span style="color: #800000">

##Software, Windows Services, LINUX DAEMON Changes
#Donut Query
Type=MyConfigurationChange_CL (ConfigChangeType_s=Software AND NOT (SoftwareName_s=*KB2461484* OR SoftwareName_s=*KB2267602*)) | measure count() by ChangeCategory_s
Type=MyConfigurationChange_CL ConfigChangeType_s=WindowsServices SvcChangeType_s!=State And Not (SvcName_s=BITS And SvcChangeType_s=StartupType) | measure count() by SvcChangeType_s
Type=MyConfigurationChange_CL (ConfigChangeType_s=Daemons AND (SvcChangeType_s=StartupType OR SvcChangeType_s=Path OR SvcChangeType_s=Runlevels)) | measure count() by SvcChangeType_s
#List Query
Type=MyConfigurationChange_CL (ConfigChangeType_s=Software AND NOT (SoftwareName_s=*KB2461484* OR SoftwareName_s=*KB2267602*)) | measure count() as Count by Computer | top 500000
Type=MyConfigurationChange_CL ConfigChangeType_s=WindowsServices SvcChangeType_s!=State And Not (SvcName_s=BITS And SvcChangeType_s=StartupType) | measure count() as Count by Computer | top 500000
Type=MyConfigurationChange_CL (ConfigChangeType_s=Daemons AND (SvcChangeType_s=StartupType OR SvcChangeType_s=Path OR SvcChangeType_s=Runlevels)) | measure count() as Count by Computer | top 500000
#Navigation Query
Type=MyConfigurationChange_CL (ConfigChangeType_s=Software AND NOT (SoftwareName_s=*KB2461484* OR SoftwareName_s=*KB2267602*)) | measure count() as Count by Computer
Type=MyConfigurationChange_CL ConfigChangeType_s=WindowsServices SvcChangeType_s!=State And Not (SvcName_s=BITS And SvcChangeType_s=StartupType) | measure count() as Count by Computer 
Type=MyConfigurationChange_CL (ConfigChangeType_s=Daemons AND (SvcChangeType_s=StartupType OR SvcChangeType_s=Path OR SvcChangeType_s=Runlevels))</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div><u><br><br><br><strong>Cleaning Up:</strong></u><br><br>To clean up the <strong>Custom Fields </strong>of this Custom Log Type from an OMS Workspace, go to <strong>Settings –&gt; Data –&gt; Custom Fields –&gt; Manage custom fields</strong>, and click <strong>Remove </strong>to remove them: <br>&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/11/image84.png" width="609" height="198">&nbsp;<br><br><br>&nbsp; <p><br><br><em>A shout out and word of thanks to my colleague Ben Shy (OMS PM) for helping me figure out how to allow the $TimeStampField variable to specify a timestamp field to use from a record’s data.</em><br><br><br><br><br><br><strong>Additional Resources:</strong> 
<p>Log Analytics HTTP Data Collector API by Brian Wren<br><a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/" target="_blank">https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/</a> 
<p>HTTP Data Collector API: Send us data from space… or anywhere! by Evan Hissey<br><a href="https://blogs.technet.microsoft.com/msoms/2016/08/30/http-data-collector-api-send-us-data-from-space-or-anywhere/" target="_blank">https://blogs.technet.microsoft.com/msoms/2016/08/30/http-data-collector-api-send-us-data-from-space-or-anywhere/</a> 
<p>Change Tracking solution in Log Analytics by Bill Anderson<br><a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-change-tracking/" target="_blank">https://azure.microsoft.com/en-us/documentation/articles/log-analytics-change-tracking/</a> 
<p>&nbsp; <p><em><font size="3" face="Arial"><br></font></em>&nbsp;</p>
<p><br><em><font size="3" face="Arial">&nbsp; <br></font></em><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.<br><br></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Keep Track of the SCOM 2016 Upgrade Process with the Upgrade Helper</title>
      <link>https://docs.microsoft.com/archive/blogs/wei_out_there_with_system_center/keep-track-of-the-scom-2016-upgrade-process-with-the-upgrade-helper</link>
      <pubDate>Fri, 14 Oct 2016 14:10:00 GMT</pubDate>
      <dc:creator><![CDATA[Wei H Lim]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/?p=3925</guid>
      <description><![CDATA[This post demonstrates how the Sample Upgrade Helper Management Pack for SCOM 2012 R2 to 2016 can be...]]></description>
      <content:encoded><![CDATA[<p>This post demonstrates how the <a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2016/10/03/introducing-the-new-upgrade-helper-mp-for-scom-2012-r2-to-2016/" target="_blank">Sample Upgrade Helper Management Pack for SCOM 2012 R2 to 2016</a> can be used to keep track of the upgrade process of a System Center 2012 R2 Operations Manager <strong>Distributed Management Group </strong>to 2016. This sample MP can be downloaded from the <a href="https://gallery.technet.microsoft.com/Sample-Management-Pack-fd15caa7" target="_blank">TechNet Gallery</a>.<br><br>In this example, the Management Server hosting the RMS emulator role in a lab environment was the starting point of the upgrade. However, starting the upgrade from the RMS Emulator Role is <strong>OPTIONAL</strong>. Upgrade can start from any management server in the management group. Here is a topology view of this distributed management group: <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image560.png" width="632" height="426"> </p> <p><br>The management servers run on Windows Server 2012 R2 and the SQL Server version is SQL Server Enterprise Edition (64bit) 2014 (12.0.2000.8). All the virtual machines are running on a Hyper-V host. <br>For more information on the System Requirements for System Center 2016, go to <br><a title="https://technet.microsoft.com/en-us/system-center-docs/system-requirements/system-requirements" href="https://technet.microsoft.com/en-us/system-center-docs/system-requirements/system-requirements" target="_blank">https://technet.microsoft.com/en-us/system-center-docs/system-requirements/system-requirements</a><br><br><strong>Important Note:</strong> <br>When upgrading multiple management servers in a distributed management group, only start upgrade of additional management servers until <strong>AFTER</strong> <strong>SETUP ON THE FIRST MANAGEMENT SERVER COMPLETES</strong>. Failing to do so can result in database issues.  <p><br>The <a href="https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2016/10/03/introducing-the-new-upgrade-helper-mp-for-scom-2012-r2-to-2016/" target="_blank">Sample Upgrade Helper Management Pack</a> can only be imported into a System Center 2012 R2 Operations Manager management group at UR3 and above. After importing the management pack, the initial upgrade state of this distributed management group shown on the Summary Dashboard was as follows: <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;margin: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image561.png" width="1007" height="619">&nbsp;<br><strong>Select any object in each state widget available in the Summary Dashboard and read the important notes specified in the Recommendations widget.</strong><br><br>When the System Center 2016 Operations Manager installation media was run on the Management Server that is hosting the RMS emulator role, the <strong>upgrade wizard</strong> page listed the following existing features to be upgraded:<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image562.png" width="743" height="351">&nbsp;<br><br>As the Operations Console was available on this Management Server, the <strong>Microsoft Report Viewer 2015 Runtime redistributable package</strong> (<a href="https://www.microsoft.com/en-us/download/details.aspx?id=45496" target="_blank">download here</a>) and the <strong>Microsoft System CLR Type for Microsoft&nbsp; SQL Server 2014</strong> (<a href="https://www.microsoft.com/en-au/download/details.aspx?id=42295" target="_blank">download here</a>) were required:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image563.png" width="473" height="301"> <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image564.png" width="749" height="348">&nbsp;<br><br><br>When all prerequisites were met, the credentials of the <strong>Configuration &amp; Data Access Service account</strong> used in each of the management servers in this management group was applied to the fields in the Configuration page (the Local System Account was not used for these services in this management group):<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image565.png" width="755" height="339"> <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image566.png" width="727" height="285"> </p> <p><br>After this, the upgrade was able to proceed with the default settings accepted for all other pages. Upgrade of the RMS Emulator and databases completed successfully as shown on the following Setup Complete page (the Retail License was not applied at that point):  <p><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image567.png" width="747" height="502">&nbsp;<br><br><br>The new upgrade state of the distributed management group shown on the Summary Dashboard was as follows: <br>– Notice that the upgrade state of the RMS Emulator is now in Healthy state, and that the overall upgrade state of the management group is still in Warning state with 33.33% core components upgraded at this stage.&nbsp; <br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image568.png" width="1177" height="623">&nbsp;<br><br><br>Next, running the upgrade wizard on the additional Management Server listed the following existing features to be upgraded, <br>– The Operational Database and the DW database were not listed as they were already upgraded earlier on from the RMS Emulator.</p> <p><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image569.png" width="740" height="264">&nbsp;<br><br>When all prerequisites were met and the credentials of the <strong>Configuration &amp; Data Access Service account</strong> was provided, upgrade was able to proceed with the default settings accepted for all other pages. <br><br>Upgrade of the additional Management Server completed successfully as shown on the following Setup Complete page:<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image570.png" width="693" height="557">&nbsp;<br><br><br>The new upgrade state of the distributed management group shown on the Summary Dashboard was as follows: <br>– Notice that the upgrade state of the additional management server – OMMS02.contoso.com, is now in Healthy state, and that the overall upgrade state of the management group is still in Warning state with 66.67% core components upgraded at this stage.<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image571.png" width="1177" height="625"> <br><br><br>Next, the Gateway server was upgraded to 2016 by running the upgrade wizard on the Gateway Server and using the default settings:<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image572.png" width="1000" height="407">&nbsp;<br><br><br>The new upgrade state of the distributed management group shown on the Summary Dashboard was as follows: <br>– Notice that the upgrade state of the gateway server – DC.contoso.com, is now in Healthy state, and that the overall upgrade state of the management group is now in <strong>Healthy state with 100% core components upgraded successfully</strong>.<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image573.png" width="1182" height="619">&nbsp;<br><br><br>The database server with the reporting server role was then upgraded to 2016 as well using the default settings:<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image581.png" width="620" height="241"><br></p> <p><br><br>The last step involved upgrading the Windows agents to 2016 via:</p> <ol> <li>the Pending Management view for remotely manageable agents, and  <li>manually for manually installed agents</li></ol> <p>On the <strong>Agent Detail Dashboard</strong> of the Upgrade Helper, the Windows agents that are yet to be upgraded to 2016 showed a blue bar marker in the <strong>ToUpgrade</strong> column:</p> <p><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image574.png" width="719" height="219"><br><br><br>After approving the 3 remotely manageable agents in this distributed management group for agent update in the Pending Management view, their ToUpgrade column showed a “0” value on the Agent Detail Dashboard.</p> <p><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image575.png" width="520" height="240">&nbsp;<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image576.png" width="1130" height="394"><br><br><br>At this stage, the Summary Dashboard was showing that 75% of agents have been upgraded to 2016.<br><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image577.png" width="1198" height="612"><br><br><br><br>After manually upgrading the last agent in this distributed management group, the overall agent upgrade status was at 100% on the Summary Dashboard.<br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image582.png" width="789" height="513">&nbsp;<img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image583.png" width="522" height="402"></p> <p><br><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/10/image578.png" width="1214" height="622">&nbsp;<br><br><br></p> <p align="left"><br><br><strong>Additional Resources:<br><br></strong>Resources &amp; Tips About Upgrading To SCOM 2016 by Marnix Wolf<br><a title="https://thoughtsonopsmgr.blogspot.com.au/2016/10/resources-tips-about-upgrading-to-scom.html?utm_source=twitterfeed&amp;utm_medium=twitter" href="https://thoughtsonopsmgr.blogspot.com.au/2016/10/resources-tips-about-upgrading-to-scom.html" target="_blank">https://thoughtsonopsmgr.blogspot.com.au/2016/10/resources-tips-about-upgrading-to-scom.html</a><br><br><br><br></p> <p></p> <p><br><em><font size="3" face="Arial">&nbsp; <br></font></em><font size="3" face="Arial">Disclaimer: <br>All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.<br><br></font></p>]]></content:encoded>
    </item>
  </channel>
</rss>