<?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>Jamie's System Center Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jamoyer/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jamoyer/feed.xml</link>
    <description>Posts in this blog are provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:50:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SCCM Scheduler Insights Script – Look inside the scheduler queue</title>
      <link>https://docs.microsoft.com/archive/blogs/jamoyer/sccm-scheduler-insights-script-look-inside-the-scheduler-queue</link>
      <pubDate>Tue, 03 Jan 2012 12:04:00 GMT</pubDate>
      <dc:creator><![CDATA[Jamoyer]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jamoyer/2012/01/03/sccm-scheduler-insights-script-look-inside-the-scheduler-queue/</guid>
      <description><![CDATA[I was recently working with a customer who often finds themselves digging through the scheduler.log...]]></description>
      <content:encoded><![CDATA[<p>I was recently working with a customer who often finds themselves digging through the scheduler.log file on various SCCM sites in their environment and wanted an ‘easier’ way to see what jobs are queued up and glean some more information – more rapidly.</p>  <p>This seemed to me to be a good excuse to dig into PowerShell, as I had not yet done very much work with it.</p>  <p>The result is a PowerShell script that I am sharing here called <strong><em>SchedulerInsights</em></strong>, details are below. If you find any issues or have any recommendations as to changes, please let me know.</p>  <p><strong>Details/Sample:</strong></p>  <p><strong></strong></p>  <ol>   <li>The script has two parameters:      <ul>       <li>-Log          <ul>           <li>The full path to the schedule.log file you’d like to parse </li>         </ul>       </li>        <li>-Data          <ul>           <li>There are two possible values for –Data              <ul>               <li><strong>CurrentJobs</strong>                  <ul>                   <li><a href="https://www.moyerteam.com/wp-content/uploads/2011/11/image2.png"><img title="image" border="0" alt="image" src="https://www.moyerteam.com/wp-content/uploads/2011/11/image_thumb2.png" width="661" height="428" /></a></li>                 </ul>               </li>                <li><strong>CountsBySite</strong>                  <ul>                   <li><a href="https://www.moyerteam.com/wp-content/uploads/2011/11/image1.png"><img title="image" border="0" alt="image" src="https://www.moyerteam.com/wp-content/uploads/2011/11/image_thumb1.png" width="661" height="313" /></a></li>                 </ul>               </li>             </ul>           </li>         </ul>       </li>     </ul>   </li> </ol>  <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:fe3b57dd-fcc6-4644-a46e-2f50bcf7baf8" class="wlWriterEditableSmartContent"><pre style=" width: 725px; height: 636px;background-color:White;overflow: scroll;"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
https://www.CodeHighlighter.com/

--><span style="color: #000000;">&lt;</span><span style="color: #008000;">#
</span><span style="color: #000000;">.SYNOPSIS
   &lt;SCCM Scheduler Log Insights version </span><span style="color: #000000;">1.5</span><span style="color: #000000;"> by Jamie Moyer</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
.DESCRIPTION
   &lt;Given a schedule log from an SCCM server, parses and displays the current send requests.  Also, shows the current Job Count and total size of Remaining data to be sent to each site </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> MBs</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
.PARAMETER &lt;Log</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
   &lt;Full path to the scheduler.log file you would like to parse</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
.PARAMETER &lt;Data</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
&lt;Whether you want stats by site or the list of current jobs returned</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
.EXAMPLE
    .\SchedulerInsights.ps1 </span><span style="color: #000000;">-</span><span style="color: #000000;">Log \\SMSServer\c</span><span style="color: #000000;">$</span><span style="color: #000000;">\SMS\Logs\Schedule.log </span><span style="color: #000000;">-</span><span style="color: #000000;">Data CurrentJobs
.EXAMPLE
    .\SchedulerInsights.ps1 </span><span style="color: #000000;">-</span><span style="color: #000000;">Log \\SMSServer\c</span><span style="color: #000000;">$</span><span style="color: #000000;">\SMS\Logs\Schedule.log </span><span style="color: #000000;">-</span><span style="color: #000000;">Data CountsBySite
</span><span style="color: #008000;">#</span><span style="color: #008000;">&gt;</span><span style="color: #008000;">
</span><span style="color: #000000;">
</span><span style="color: #008000;">#</span><span style="color: #008000;">Get Parameters passed</span><span style="color: #008000;">
</span><span style="color: #000000;"> </span><span style="color: #0000FF;">param</span><span style="color: #000000;">(</span><span style="color: #800080;">$Log</span><span style="color: #000000;">,</span><span style="color: #800080;">$Data</span><span style="color: #000000;">)

</span><span style="color: #800080;">$SchedulerQueue</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: #0000FF;">function</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">JobData() {
      </span><span style="color: #0000FF;">param</span><span style="color: #000000;"> (</span><span style="color: #800080;">$line</span><span style="color: #000000;">)
      </span><span style="color: #800080;">$job</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 PSObject
      </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name SendRequest </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$line</span><span style="color: #000000;">.ToString().Trim().Substring(</span><span style="color: #000000;">13</span><span style="color: #000000;">, </span><span style="color: #000000;">8</span><span style="color: #000000;">).Trim();
      </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name PkgID </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">;
      </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name Version </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">;

      </span><span style="color: #800080;">$RegexMatches</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> ([regex]</span><span style="color: #000000;">::</span><span style="color: #000000;">matches(</span><span style="color: #800080;">$line</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">\b\w+:[\w\s]+\b(?!:)</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))      

      </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #800080;">$RegexMatches</span><span style="color: #000000;">)
      {
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">JobID</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){ </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name JobID </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim();</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">DestSite</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){ </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name DestSite </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim();</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">FinalSite</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){ </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name FinalSite </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim();</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</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: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name State </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim();</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Status</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){ </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name Status </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim();</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">size</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){ </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name sizeKb </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim().TrimEnd('k');</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Remaining</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){ </span><span style="color: #800080;">$job</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member </span><span style="color: #000000;">-</span><span style="color: #000000;">type NoteProperty </span><span style="color: #000000;">-</span><span style="color: #000000;">name RemainingKb </span><span style="color: #000000;">-</span><span style="color: #000000;">value </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim().TrimEnd('k');</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">PkgID</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){    </span><span style="color: #800080;">$job</span><span style="color: #000000;">.PkgID </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim().Substring(</span><span style="color: #000000;">0</span><span style="color: #000000;">, </span><span style="color: #000000;">8</span><span style="color: #000000;">).Trim();</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Version</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)){ </span><span style="color: #800080;">$job</span><span style="color: #000000;">.Version </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$match</span><span style="color: #000000;">.Value.ToString().Trim().Split(':')[</span><span style="color: #000000;">1</span><span style="color: #000000;">].Trim();</span><span style="color: #0000FF;">continue</span><span style="color: #000000;">;}
      } 

    </span><span style="color: #008000;">#</span><span style="color: #008000;">Handle adding only the most recent objects to the hash table</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;">$SchedulerQueue</span><span style="color: #000000;">.ContainsKey(</span><span style="color: #800080;">$job</span><span style="color: #000000;">.SendRequest))
    {
            </span><span style="color: #800080;">$SchedulerQueue</span><span style="color: #000000;">.Remove(</span><span style="color: #800080;">$job</span><span style="color: #000000;">.SendRequest);</span><span style="color: #008000;">#</span><span style="color: #008000;"> //always remove existing entry </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;">$job</span><span style="color: #000000;">.Status.Trim() </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;">$SchedulerQueue</span><span style="color: #000000;">.Add(</span><span style="color: #800080;">$job</span><span style="color: #000000;">.SendRequest, </span><span style="color: #800080;">$job</span><span style="color: #000000;">);
            }
    }
    </span><span style="color: #0000FF;">elseif</span><span style="color: #000000;"> (</span><span style="color: #800080;">$job</span><span style="color: #000000;">.Status.Trim() </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;">$SchedulerQueue</span><span style="color: #000000;">.Add(</span><span style="color: #800080;">$job</span><span style="color: #000000;">.SendRequest, </span><span style="color: #800080;">$job</span><span style="color: #000000;">);
    } 

    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #800080;">$job</span><span style="color: #000000;">;
}

</span><span style="color: #0000FF;">function</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MostRecentJobData()
{
    </span><span style="color: #800080;">$r</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.collections.arraylist;
    </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;">(</span><span style="color: #800080;">$j</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #800080;">$SchedulerQueue</span><span style="color: #000000;">.Values)
    {
        [void]</span><span style="color: #800080;">$r</span><span style="color: #000000;">.Add(</span><span style="color: #800080;">$j</span><span style="color: #000000;">)
    }
    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #800080;">$r</span><span style="color: #000000;">;
}

</span><span style="color: #0000FF;">function</span><span style="color: #000000;"> Get</span><span style="color: #000000;">-</span><span style="color: #000000;">SiteCounts
{
  </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;">(</span><span style="color: #800080;">$site</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #800080;">$Input</span><span style="color: #000000;">)
  {
    </span><span style="color: #800080;">$siteStats</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.Management.Automation.PsObject
    </span><span style="color: #800080;">$siteStats</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member NoteProperty SiteCode </span><span style="color: #800080;">$site</span><span style="color: #000000;">.Name
    </span><span style="color: #800080;">$siteStats</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member NoteProperty JobCount </span><span style="color: #800080;">$site</span><span style="color: #000000;">.Count
    </span><span style="color: #800080;">$siteStats</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Add</span><span style="color: #000000;">-</span><span style="color: #000000;">Member NoteProperty TotalJobSizeMb ((</span><span style="color: #800080;">$site</span><span style="color: #000000;">.Group </span><span style="color: #000000;">|</span><span style="color: #000000;"> Measure</span><span style="color: #000000;">-</span><span style="color: #000000;">Object </span><span style="color: #000000;">-</span><span style="color: #000000;">Sum RemainingKb).Sum </span><span style="color: #000000;">/</span><span style="color: #000000;">1024</span><span style="color: #000000;">)
    </span><span style="color: #800080;">$siteStats</span><span style="color: #000000;">
  }
}

</span><span style="color: #008000;">#</span><span style="color: #008000;">MAIN</span><span style="color: #008000;">
</span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$Data</span><span style="color: #000000;">.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">CurrentJobs</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))
{
    </span><span style="color: #800080;">$JobLines</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Select</span><span style="color: #000000;">-</span><span style="color: #000000;">String </span><span style="color: #800080;">$Log</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">pattern </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">DestSite</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Select</span><span style="color: #000000;">-</span><span style="color: #000000;">Object Line </span><span style="color: #000000;">|</span><span style="color: #0000FF;">ForEach</span><span style="color: #000000;">-</span><span style="color: #000000;">Object {Get</span><span style="color: #000000;">-</span><span style="color: #000000;">JobData(</span><span style="color: #800080;">$_</span><span style="color: #000000;">.Line)}</span><span style="color: #000000;">|</span><span style="color: #000000;">Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MostRecentJobData</span><span style="color: #000000;">|</span><span style="color: #000000;">Out</span><span style="color: #000000;">-</span><span style="color: #000000;">GridView
}
</span><span style="color: #0000FF;">elseif</span><span style="color: #000000;">(</span><span style="color: #800080;">$Data</span><span style="color: #000000;">.contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">CountsBySite</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))
{
    </span><span style="color: #800080;">$JobLines</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> Select</span><span style="color: #000000;">-</span><span style="color: #000000;">String </span><span style="color: #800080;">$Log</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">pattern </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">DestSite</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">|</span><span style="color: #000000;"> Select</span><span style="color: #000000;">-</span><span style="color: #000000;">Object Line </span><span style="color: #000000;">|</span><span style="color: #0000FF;">ForEach</span><span style="color: #000000;">-</span><span style="color: #000000;">Object {Get</span><span style="color: #000000;">-</span><span style="color: #000000;">JobData(</span><span style="color: #800080;">$_</span><span style="color: #000000;">.Line)}</span><span style="color: #000000;">|</span><span style="color: #000000;">Get</span><span style="color: #000000;">-</span><span style="color: #000000;">MostRecentJobData</span><span style="color: #000000;">|</span><span style="color: #000000;">Group</span><span style="color: #000000;">-</span><span style="color: #000000;">Object </span><span style="color: #000000;">-</span><span style="color: #000000;">Property DestSite</span><span style="color: #000000;">|</span><span style="color: #000000;">Get</span><span style="color: #000000;">-</span><span style="color: #000000;">SiteCounts </span><span style="color: #000000;">|</span><span style="color: #000000;"> Sort </span><span style="color: #000000;">-</span><span style="color: #000000;">Desc TotalJobSizeMb </span><span style="color: #000000;">|</span><span style="color: #000000;"> Out</span><span style="color: #000000;">-</span><span style="color: #000000;">GridView
}


</span></div></pre><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  https://dunnhq.com --></div>]]></content:encoded>
    </item>
    <item>
      <title>Update Computer Account Group Membership without Rebooting</title>
      <link>https://docs.microsoft.com/archive/blogs/jamoyer/update-computer-account-group-membership-without-rebooting</link>
      <pubDate>Wed, 30 Jan 2008 12:48:43 GMT</pubDate>
      <dc:creator><![CDATA[Jamoyer]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jamoyer/2008/01/30/update-computer-account-group-membership-without-rebooting/</guid>
      <description><![CDATA[Often times when working with SMS 2003 in advanced security mode the need arises to add computer...]]></description>
      <content:encoded><![CDATA[<blockquote>   <p>Often times when working with SMS 2003 in advanced security mode the need arises to add computer objects to active directory groups. Normally for a computer account to become aware of the group membership change a reboot is required.&#160; Often it is difficult to arrange for the scheduled downtime necessary to reboot a production server. </p>    <p>I've used the below procedure to update the computer's security token without rebooting.&#160; This does take a bit of effort, but it doesn't involve rebooting your server.</p>    <ul>     <li>Download the <a href="https://www.microsoft.com/downloads/details.aspx?FamilyID=1581e6e7-7e64-4a2d-8aba-73e909d2a7dc&amp;DisplayLang=en ">Klist</a> utility. You'll need to install the .msi package and get klist.exe from the install directory.</li>      <li>Next you need to launch an interactive command prompt running as the system account</li>   </ul>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Click Start -&gt; Run -&gt;&#160; <strong>&quot;AT &lt;time&gt; /i cmd.exe&quot;&#160; </strong></p>    <ul>     <li><strong>(NOTE:</strong>&#160; If you are trying to launch an interactive command prompt via a remote desktop session to your server you will need to be logged on to session 0 to see the command prompt.&#160; You can do this by using the following command when connecting to the server.<strong>&#160; &quot;mstsc /console&quot;</strong> )</li>      <li>When command prompt is launched.</li>   </ul>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Run &quot;<strong>klist purge&quot;</strong></p>    <ul>     <li>Run Gpupdate <strong>/force</strong></li>   </ul>    <p>&#160;</p>    <p>Your computer's security token should now be updated.</p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Analyzing SMS/ConfigMgr log files the easy way!</title>
      <link>https://docs.microsoft.com/archive/blogs/jamoyer/analyzing-smsconfigmgr-log-files-the-easy-way</link>
      <pubDate>Mon, 28 Jan 2008 12:27:00 GMT</pubDate>
      <dc:creator><![CDATA[Jamoyer]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jamoyer/2008/01/28/analyzing-smsconfigmgr-log-files-the-easy-way/</guid>
      <description><![CDATA[How do you parse log files today?
Do you routinely troubleshoot issues with SMS clients?&nbsp;...]]></description>
      <content:encoded><![CDATA[<P><STRONG>How do you parse log files today?</STRONG></P>
<P>Do you routinely troubleshoot issues with SMS clients?&nbsp; Issues such as WMI not functioning, CCMEXEC not running, Bits issues, etc. The place I always start my troubleshooting is with the client <A href="https://support.microsoft.com/kb/867490" mce_href="https://support.microsoft.com/kb/867490">log files</A> (C:\Windows\System32\ccm\logs) as they contain a wealth of information and usually quickly lead you down the road to problem resolution.</P>
<P>In the past I've used simple scripts to parse the log files and that has worked fairly well, I've also fallen victim to manually opening log files one by one (by relevance to the problem I am working on) and looking/searching for keywords like 'failed' or 'error' or searching for a particular PackageID and it's associated entries.&nbsp; Although this works fine, it is very time consuming and tedious.</P>
<P><STRONG></STRONG></P>
<P><STRONG>An easier way to get the same results:</STRONG></P>
<P>Recently I've begun using a tool called <A href="https://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx" mce_href="https://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx">Log Parser</A> to quickly parse through SMS client log files on both local and remote locations.&nbsp; The beauty of using log parser is in it's simplicity, it provides query based access to numerous types of data.&nbsp; For this scenario the data we care about is in the SMS client log files, which it handles with ease.</P>
<P><STRONG></STRONG></P>
<P><STRONG>Parsing SMS client log files on a remote machine and getting results in a datagrid:</STRONG></P>
<P>1. Open a command prompt and go the the log parser directory (C:\program files\Log Parser 2.2)</P>
<P>2. In the below example I am going to parse all the sms client log files on a remote system (LabExchange2003) and return every instance of the word 'failed' to an easy to navigate datagrid.</P>
<BLOCKQUOTE>
<P><STRONG>a</STRONG>: logparser -o:datagrid -i:TEXTLINE "select * from \\labexchange2003\c$\windows\system32\ccm\logs\*.log where text like '%failed%'"</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_2.png" original-url="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_2.png" mce_href="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_2.png"><IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=144 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb.png" original-url="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb.png" width=824 border=0 mce_src="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb.png"></A> </P>
<P>Notice the results datagrid that is produced, you see the log file name where the match was found and the text. Initially the datagrid shows the first 10 rows, you then have the option to show the next 10 or show all.</P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_4.png" original-url="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_4.png" mce_href="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_4.png"><IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=293 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb_1.png" original-url="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb_1.png" width=751 border=0 mce_src="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb_1.png"></A> </P></BLOCKQUOTE>
<P><STRONG>Visual Log Parser:</STRONG></P>
<P>Another option for utilizing log parser is to use <A href="https://www.serialcoder.net/deploy/visual-logparser/publish.htm" mce_href="https://www.serialcoder.net/deploy/visual-logparser/publish.htm">Visual Log Parser</A> from SerialCoder.net. This is a front-end to Log Parser that makes searching log files even more user friendly.</P>
<P>Here is a screenshot of the UI and a sample query:</P>
<BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_6.png" original-url="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_6.png" mce_href="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_6.png"><IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=559 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb_2.png" original-url="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb_2.png" width=936 border=0 mce_src="https://blogs.msdn.com/blogfiles/jamoyer/WindowsLiveWriter/AnalyzingSMSlogstheeasyway_758D/image_thumb_2.png"></A> </P></BLOCKQUOTE>
<P><STRONG>Conclusion:</STRONG></P>
<P>Log Parser is a very powerful tool, and while this article just touches the surface on it's capabilities I hope it serves as a good primer to help you become familiar with the tool and save you some time.</P>
<P><STRONG>Future Resources:</STRONG></P>
<P>Stay tuned to this blog for scripts/ideas around using log parser to assist with troubleshooting sms client &amp; server issues.</P>
<P><STRONG>Additional Resources:</STRONG></P>
<P><STRONG><A href="https://www.codeplex.com/visuallogparser" mce_href="https://www.codeplex.com/visuallogparser">Visual Log Parser on Codeplex</A></STRONG></P>
<P><STRONG><A href="https://technet.microsoft.com/en-us/library/bb878032.aspx" mce_href="https://technet.microsoft.com/en-us/library/bb878032.aspx">Great Technet article on using Log Parser</A></STRONG></P>
<P><B><A href="https://www.codinghorror.com/blog/archives/000369.html" mce_href="https://www.codinghorror.com/blog/archives/000369.html">What if everything could be queried with SQL?</A></B></P>
<P><STRONG><A href="https://www.microsoft.com/technet/scriptcenter/resources/tales/sg0105.mspx" mce_href="https://www.microsoft.com/technet/scriptcenter/resources/tales/sg0105.mspx">Scripting with Log Parser</A></STRONG></P>
<P><STRONG><A href="https://geekswithblogs.net/drewby/articles/LogParser.aspx" mce_href="https://geekswithblogs.net/drewby/articles/LogParser.aspx">Another Great Article on Using Log Parser to read log files and using its COM object</A></STRONG></P>
<P><STRONG><A class="" href="https://myitforum.com/cs2/blogs/pthomsen/archive/2008/01/27/111954.aspx" mce_href="https://myitforum.com/cs2/blogs/pthomsen/archive/2008/01/27/111954.aspx">Paul Thomsen wrote a great series on analyzing SMS log files using vbscript</A></STRONG></P>]]></content:encoded>
    </item>
  </channel>
</rss>