<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Scot,
    <blockquote
      cite="mid:59E62072D4EFFF4BB912EC607F8FA60B02ECCB26@lzbs6304.na.lzb.hq"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle26
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle27
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle28
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle29
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle30
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">David,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I'm
            pretty motivated to try and get this to work. BBWin is
            abandoned and it's only a matter of time until it quits
            working entirely, and the PS client is currently the only
            answer.  I see two problems with the PS client that are
            holding it back from being a replacement for BBWin.  <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">First,
            the services information is unreliable.  This can fix that,
            if we can make it work.  <o:p></o:p></span></p>
      </div>
    </blockquote>
    If you are happy to do without the PID of currently running
    services, can probably grab service startup status from registry and
    be done with it.<br>
    <blockquote
      cite="mid:59E62072D4EFFF4BB912EC607F8FA60B02ECCB26@lzbs6304.na.lzb.hq"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p></o:p>Second,
            the PS client as a whole is a bit of a hog.  It takes 8-10
            seconds at 100% CPU to run with no logfiles.  Contrast that
            with BBWin which takes 3-4 seconds including logfiles.  I've
            already had two admins ask to remove the PS client because
            users were seeing an impact. <o:p></o:p></span></p>
      </div>
    </blockquote>
    Completely agree that the overhead has to be as low as possible. A
    monitoring agent shouldn't impact unduly on what it is monitoring!<br>
    <blockquote
      cite="mid:59E62072D4EFFF4BB912EC607F8FA60B02ECCB26@lzbs6304.na.lzb.hq"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I
            did add the following line to the top of the PS client to
            get it to run at the lowest priority of the system:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">get-Process 
            -id $PID | foreach {$_.PriorityClass=
            [System.Diagnostics.ProcessPriorityClass]::Idle}<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
      </div>
    </blockquote>
    I can add an option to set the priority of the client at startup.<br>
    <blockquote
      cite="mid:59E62072D4EFFF4BB912EC607F8FA60B02ECCB26@lzbs6304.na.lzb.hq"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">that
            way hopefully it will cause less of an impact on the system
            as the PS client is strictly CPU load.  I'll try using Ray's
            P/Invoke, but it may be above my head as I am not a
            programmer.<o:p></o:p></span></p>
      </div>
    </blockquote>
    I really can't get excited about such gruesome delving into the
    bowels of Windows. A big attraction of using PS in the first place
    should be to avoid resorting to such ugly machinery. .Net classes
    and WMI is fair enough (as long as they don't overly burden the
    system), COM objects so-so, but directly invoking DLLs and similar
    seems pretty fragile as a long term proposition.<br>
    <br>
    David.<br>
    <blockquote
      cite="mid:59E62072D4EFFF4BB912EC607F8FA60B02ECCB26@lzbs6304.na.lzb.hq"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
        <div>
          <p class="MsoNormal"><span style="font-family:
              "Arial","sans-serif"; color: rgb(31,
              73, 125);">Scot Kreienkamp<o:p></o:p></span></p>
        </div>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><o:p> </o:p></span></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; border-color:
            rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;
            padding: 3pt 0in 0in;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  "Tahoma","sans-serif"; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                "Tahoma","sans-serif"; color:
                windowtext;"> David Baldwin
                [<a class="moz-txt-link-freetext" href="mailto:david.baldwin@ausport.gov.au">mailto:david.baldwin@ausport.gov.au</a>] <br>
                <b>Sent:</b> Wednesday, June 01, 2011 10:49 PM<br>
                <b>To:</b> Storer, Raymond<br>
                <b>Cc:</b> Scot Kreienkamp; <a class="moz-txt-link-abbreviated" href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
                <b>Subject:</b> Re: [Xymon] Windows PS client svcs data
                missing<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I can't see that this code gets anything
          more than Get-Service - since Get-Service is an interface to
          [System.ServiceProcess.ServiceController]<br>
          <br>
          Some of the info can be derived from the registry or running
          SC.EXE - registry interpretation requires information about
          enumerations for various keys, SC would require parsing
          output. Neither gives you information about the running
          process if there is one which also used by the client.<br>
          <br>
          Looks like no way of getting away from the overhead of WMI -
          digging around for extra information or messing around with
          unstructured text will get you so far, but not all the info
          sought.<br>
          <br>
          David.<br>
          <br>
          PS C:\WINDOWS\system32\windowspowershell\v1.0>
          Get-WmiObject -Filter "Name='dnscache'" win32_service | fl *<br>
          <br>
          <br>
          Name                    : Dnscache<br>
          Status                  : OK<br>
          ExitCode                : 0<br>
          DesktopInteract         : False<br>
          ErrorControl            : Normal<br>
          PathName                : C:\WINDOWS\system32\svchost.exe -k
          NetworkService<br>
          ServiceType             : Share Process<br>
          StartMode               : Auto<br>
          __GENUS                 : 2<br>
          __CLASS                 : Win32_Service<br>
          __SUPERCLASS            : Win32_BaseService<br>
          __DYNASTY               : CIM_ManagedSystemElement<br>
          __RELPATH               : Win32_Service.Name="Dnscache"<br>
          __PROPERTY_COUNT        : 25<br>
          __DERIVATION            : {Win32_BaseService, CIM_Service,
          CIM_LogicalElement, CIM_ManagedSystemElement}<br>
          __SERVER                : ITMANSV<br>
          __NAMESPACE             : root\cimv2<br>
          __PATH                  : <a moz-do-not-send="true"
href="file:///%5C%5CITMANSV%5Croot%5Ccimv2:Win32_Service.Name=%22Dnscache">\\ITMANSV\root\cimv2:Win32_Service.Name="Dnscache</a>"<br>
          AcceptPause             : False<br>
          AcceptStop              : True<br>
          Caption                 : DNS Client<br>
          CheckPoint              : 0<br>
          CreationClassName       : Win32_Service<br>
          Description             : Resolves and caches Domain Name
          System (DNS) names for this computer. If this service is
          stopped, this computer will not be able to resolve DNS names
          and locate Active Directory domain controllers. If this
          service is disabled, any services that explicitly depend on it
          will fail to start.<br>
          DisplayName             : DNS Client<br>
          InstallDate             : <br>
          ProcessId               : 872<br>
          ServiceSpecificExitCode : 0<br>
          Started                 : True<br>
          StartName               : NT AUTHORITY\NetworkService<br>
          State                   : Running<br>
          SystemCreationClassName : Win32_ComputerSystem<br>
          SystemName              : ITMANSV<br>
          TagId                   : 0<br>
          WaitHint                : 0<br>
          Scope                   : System.Management.ManagementScope<br>
          Path                    : <a moz-do-not-send="true"
href="file:///%5C%5CITMANSV%5Croot%5Ccimv2:Win32_Service.Name=%22Dnscache">\\ITMANSV\root\cimv2:Win32_Service.Name="Dnscache</a>"<br>
          Options                 : System.Management.ObjectGetOptions<br>
          ClassPath               : <a moz-do-not-send="true"
            href="file:///%5C%5CITMANSV%5Croot%5Ccimv2:Win32_Service">\\ITMANSV\root\cimv2:Win32_Service</a><br>
          Properties              : {AcceptPause, AcceptStop, Caption,
          CheckPoint...}<br>
          SystemProperties        : {__GENUS, __CLASS, __SUPERCLASS,
          __DYNASTY...}<br>
          Qualifiers              : {dynamic, Locale, provider, UUID}<br>
          Site                    : <br>
          Container               : <br>
          <br>
          <br>
          <br>
          <br>
_______________________________________________________________________________________________________________________________________________<br>
          PS C:\WINDOWS\system32\windowspowershell\v1.0> Get-Service
          dnscache | fl *<br>
          <br>
          <br>
          Name                : dnscache<br>
          RequiredServices    : {Tcpip}<br>
          CanPauseAndContinue : False<br>
          CanShutdown         : False<br>
          CanStop             : True<br>
          DisplayName         : DNS Client<br>
          DependentServices   : {}<br>
          MachineName         : .<br>
          ServiceName         : dnscache<br>
          ServicesDependedOn  : {Tcpip}<br>
          ServiceHandle       : SafeServiceHandle<br>
          Status              : Running<br>
          ServiceType         : Win32ShareProcess<br>
          Site                : <br>
          Container           : <br>
          <br>
          <br>
          <br>
          <br>
_______________________________________________________________________________________________________________________________________________<br>
          PS C:\WINDOWS\system32\windowspowershell\v1.0>
          Get-ItemProperty
          HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache<br>
          <br>
          <br>
          PSPath          :
Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache<br>
          PSParentPath    :
Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services<br>
          PSChildName     : Dnscache<br>
          PSDrive         : HKLM<br>
          PSProvider      : Microsoft.PowerShell.Core\Registry<br>
          Type            : 32<br>
          Start           : 2<br>
          ErrorControl    : 1<br>
          ImagePath       : C:\WINDOWS\system32\svchost.exe -k
          NetworkService<br>
          DisplayName     : DNS Client<br>
          Group           : TDI<br>
          DependOnService : {Tcpip}<br>
          DependOnGroup   : {}<br>
          ObjectName      : NT AUTHORITY\NetworkService<br>
          Description     : Resolves and caches Domain Name System (DNS)
          names for this computer. If this service is stopped, this
          computer will not be able to resolve DNS names and locate
          Active Directory domain controllers. If this service is
          disabled, any services that explicitly depend on it will fail
          to start.<br>
          <br>
          <br>
          PS C:\WINDOWS\system32\windowspowershell\v1.0> sc.exe qc
          dnscache<br>
          [SC] QueryServiceConfig SUCCESS<br>
          <br>
          SERVICE_NAME: dnscache<br>
                  TYPE               : 20  WIN32_SHARE_PROCESS <br>
                  START_TYPE         : 2   AUTO_START<br>
                  ERROR_CONTROL      : 1   NORMAL<br>
                  BINARY_PATH_NAME   : C:\WINDOWS\system32\svchost.exe
          -k NetworkService<br>
                  LOAD_ORDER_GROUP   : TDI<br>
                  TAG                : 0<br>
                  DISPLAY_NAME       : DNS Client<br>
                  DEPENDENCIES       : Tcpip<br>
                  SERVICE_START_NAME : NT AUTHORITY\NetworkService<br>
          <br>
          <br>
          <br>
          On 2/06/11 8:50 AM, Storer, Raymond wrote: <o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Scott
            and David, I’m not finding any .net call that will produce
            the “StartupType” for a service that is already installed.
            There is a documented way to do it from a Win32 API; but,
            that involves using P/Invoke. See here: <a
              moz-do-not-send="true"
href="http://www.leeholmes.com/blog/2009/01/19/powershell-pinvoke-walkthrough/">http://www.leeholmes.com/blog/2009/01/19/powershell-pinvoke-walkthrough/</a> 
            and here: <a moz-do-not-send="true"
              href="http://pinvoke.net/default.aspx/advapi32/QueryServiceConfig.html">http://pinvoke.net/default.aspx/advapi32/QueryServiceConfig.html</a></span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Ray</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; padding: 3pt
            0in 0in; border-color: -moz-use-text-color;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  "Tahoma","sans-serif"; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                "Tahoma","sans-serif"; color:
                windowtext;"> Scot Kreienkamp [<a moz-do-not-send="true"
                  href="mailto:SKreien@la-z-boy.com">mailto:SKreien@la-z-boy.com</a>]
                <br>
                <b>Sent:</b> Wednesday, June 01, 2011 11:03 AM<br>
                <b>To:</b> Storer, Raymond; David Baldwin<br>
                <b>Cc:</b> <a moz-do-not-send="true"
                  href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
                <b>Subject:</b> RE: [Xymon] Windows PS client svcs data
                missing</span><o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">This
            is what I have so far:</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">function
            XymonSvcsNET2</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">{</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $result =
            [reflection.Assembly]::LoadWithPartialName("System.ServiceProcess")</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $Services =
            [System.ServiceProcess.ServiceController]::GetServices()</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $COLUMNNAME="Name"</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $COLUMNSTATUS="Status"</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $COLUMNDESCRIPTION="Description"</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            #[Reflection.Assembly]::Load(‘System.ServiceProcess,
            Version=2.0.0.0, Culture=neutral,
            PublicKeyToken=b03f5f7f11d50a3a’)</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            #get all the services installed on the local machine</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $serviceController =
            [System.ServiceProcess.ServiceController]::GetServices()</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            "[svcs]"</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
"--------------------------------------------------------------------------------------------------------------"</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            "{0,-50} {1,-20} {2,-20}" -f `</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $COLUMNNAME, $COLUMNSTATUS, $COLUMNDESCRIPTION</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
"--------------------------------------------------------------------------------------------------------------"</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            foreach ($svc in $serviceController) {</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            "{0,-50} {1,-20} {2,-20}" -f `</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            $svc.Name, $svc.Status, $svc.DisplayName</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            }</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">}</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I
            did get the formatting figured out finally after about 6
            hours.  The only piece that I cannot figure out is the
            service startup type, if I can get some help on that I think
            this is workable.  </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I'm
            a complete newbie at powershell, so comments/help
            appreciated.  </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <div>
          <p class="MsoNormal"><span style="font-family:
              "Arial","sans-serif";">Scot Kreienkamp</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="font-family:
              "Arial","sans-serif";">Senior Systems
              Engineer</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="font-family:
              "Arial","sans-serif";"><a
                moz-do-not-send="true"
                href="mailto:skreien@la-z-boy.com">skreien@la-z-boy.com</a></span><o:p></o:p></p>
        </div>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; padding: 3pt
            0in 0in; border-color: -moz-use-text-color;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  "Tahoma","sans-serif"; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                "Tahoma","sans-serif"; color:
                windowtext;"> <a moz-do-not-send="true"
                  href="mailto:xymon-bounces@xymon.com">xymon-bounces@xymon.com</a>
                [<a moz-do-not-send="true"
                  href="mailto:xymon-bounces@xymon.com">mailto:xymon-bounces@xymon.com</a>]
                <b>On Behalf Of </b>Storer, Raymond<br>
                <b>Sent:</b> Monday, May 16, 2011 10:38 AM<br>
                <b>To:</b> David Baldwin<br>
                <b>Cc:</b> <a moz-do-not-send="true"
                  href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
                <b>Subject:</b> Re: [Xymon] Windows PS client svcs data
                missing</span><o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">David,
            you can also use the “Load” method instead as follows:</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">[Reflection.Assembly]::Load(‘System.ServiceProcess,
            Version=2.0.0.0, Culture=neutral,
            PublicKeyToken=b03f5f7f11d50a3a’)</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"><br>
            Ray</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; padding: 3pt
            0in 0in; border-color: -moz-use-text-color;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  "Tahoma","sans-serif"; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                "Tahoma","sans-serif"; color:
                windowtext;"> David Baldwin [<a moz-do-not-send="true"
                  href="mailto:David.Baldwin@ausport.gov.au">mailto:David.Baldwin@ausport.gov.au</a>]
                <br>
                <b>Sent:</b> Monday, May 16, 2011 12:39 AM<br>
                <b>To:</b> 'Scot Kreienkamp'; Storer, Raymond<br>
                <b>Cc:</b> <a moz-do-not-send="true"
                  href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
                <b>Subject:</b> RE: [Xymon] Windows PS client svcs data
                missing</span><o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU">Ray,</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU">Thanks for the code. I’m a bit wary of using
            something with such a version specific path though – is that
            seriously a “standard” interface to a .Net DLL that can be
            expected to have some degree of persistence?</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU">I’m offsite this week, will try to take a look
            next week.</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU">Thanks, David.</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"
            lang="EN-AU"> </span><o:p></o:p></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; padding: 3pt
            0in 0in; border-color: -moz-use-text-color;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  "Tahoma","sans-serif"; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                "Tahoma","sans-serif"; color:
                windowtext;"> Scot Kreienkamp [<a moz-do-not-send="true"
                  href="mailto:SKreien@la-z-boy.com">mailto:SKreien@la-z-boy.com</a>]
                <br>
                <b>Sent:</b> Saturday, 14 May 2011 5:54 AM<br>
                <b>To:</b> Storer, Raymond; David Baldwin<br>
                <b>Cc:</b> <a moz-do-not-send="true"
                  href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
                <b>Subject:</b> RE: [Xymon] Windows PS client svcs data
                missing</span><o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"><span lang="EN-AU"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Thank
            you Raymond… If I knew how to implement it I would. 
            Hopefully David or Henrik can find the time to experiment
            with it.  </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">I'm
            seeing all kinds of problems with the PS client…. If this
            keeps up I'll have to remove it.  It pegged one of my
            servers at 100% for over an hour, stuck on the WMI
            yesterday.  </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <div>
          <p class="MsoNormal"><span style="font-family:
              "Arial","sans-serif";">Scot Kreienkamp</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="font-family:
              "Arial","sans-serif";">Senior Systems
              Engineer</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="font-family:
              "Arial","sans-serif";"><a
                moz-do-not-send="true"
                href="mailto:skreien@la-z-boy.com">skreien@la-z-boy.com</a></span><o:p></o:p></p>
        </div>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; padding: 3pt
            0in 0in; border-color: -moz-use-text-color;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  "Tahoma","sans-serif"; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                "Tahoma","sans-serif"; color:
                windowtext;"> Storer, Raymond [<a moz-do-not-send="true"
                  href="mailto:storerr@nibco.com">mailto:storerr@nibco.com</a>]
                <br>
                <b>Sent:</b> Friday, May 13, 2011 12:58 PM<br>
                <b>To:</b> David Baldwin; Scot Kreienkamp<br>
                <b>Cc:</b> <a moz-do-not-send="true"
                  href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
                <b>Subject:</b> RE: [Xymon] Windows PS client svcs data
                missing</span><o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Opps…
            I missed the “.” in the [Reflection.Assembly]. Also, you can
            pipe it to out-null to avoid any unwanted output. So:</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">[Reflection.Assembly]::LoadFile(‘C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\System.ServiceProcess.dll’)
            | out-null</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Ray</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <div>
          <div style="border-right: medium none; border-width: 1pt
            medium medium; border-style: solid none none; padding: 3pt
            0in 0in; border-color: -moz-use-text-color;">
            <p class="MsoNormal"><b><span style="font-size: 10pt;
                  font-family:
                  "Tahoma","sans-serif"; color:
                  windowtext;">From:</span></b><span style="font-size:
                10pt; font-family:
                "Tahoma","sans-serif"; color:
                windowtext;"> <a moz-do-not-send="true"
                  href="mailto:xymon-bounces@xymon.com">xymon-bounces@xymon.com</a>
                [<a moz-do-not-send="true"
                  href="mailto:xymon-bounces@xymon.com">mailto:xymon-bounces@xymon.com</a>]
                <b>On Behalf Of </b>Storer, Raymond<br>
                <b>Sent:</b> Friday, May 13, 2011 11:40 AM<br>
                <b>To:</b> David Baldwin; Scot Kreienkamp<br>
                <b>Cc:</b> <a moz-do-not-send="true"
                  href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
                <b>Subject:</b> Re: [Xymon] Windows PS client svcs data
                missing</span><o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Scot
            and David, if you’d prefer to implement a .net pure call for
            services you can try the following:</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">#
            your path to the file may very</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">[ReflectionAssembly]::LoadFile(‘C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\System.ServiceProcess.dll’)</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">#get
            all the services installed on the local machine</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">$serviceController
            = [System.ServiceProcess.ServiceController]::GetServices()</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">foreach
            ($svc in $serviceController) {</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            # should indicate: Stopped, Running, or Paused … others???</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            write-host $svc.Status</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            # the service name</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            write-host $svc.Name</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            # the service display name</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">               
            write-host $svc.DisplayName</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">}</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">Ray</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="color: rgb(31, 73, 125);">[snip]</span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-size: 8pt; font-family:
            "Arial","sans-serif"; color: gray;"> </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif"; color:
            windowtext;"> </span><o:p></o:p></p>
        <div class="MsoNormal" style="text-align: center;"
          align="center"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif"; color:
            windowtext;">
            <hr align="center" size="2" width="100%"></span></div>
        <p class="MsoNormal"><span style="font-size: 7.5pt; font-family:
            "Arial","sans-serif"; color: gray;">CONFIDENTIALITY
            NOTICE: This email and any attachments are for the<br>
            exclusive and confidential use of the intended recipient. If
            you are not<br>
            the intended recipient, please do not read, distribute or
            take action in<br>
            reliance upon this message. If you have received this in
            error, please<br>
            notify us immediately by return email and promptly delete
            this message<br>
            and its attachments from your computer system. We do not
            waive<br>
            attorney-client or work product privilege by the
            transmission of this<br>
            message.</span><o:p></o:p></p>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"> <o:p></o:p></p>
        <p class="MsoNormal"><span style="font-size: 8pt; font-family:
            "Arial","sans-serif"; color: gray;">This
            message is intended only for the individual or entity to
            which it is addressed.  It may contain privileged,
            confidential information which is exempt from disclosure
            under applicable laws.  If you are not the intended
            recipient, please note that you are strictly prohibited from
            disseminating or distributing this information (other than
            to the intended recipient) or copying this information.  If
            you have received this communication in error, please notify
            us immediately by e-mail or by telephone at the above
            number. Thank you. </span><o:p></o:p></p>
        <p class="MsoNormal"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";"><o:p> </o:p></span></p>
        <div class="MsoNormal" style="text-align: center;"
          align="center"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";">
            <hr align="center" size="2" width="100%"></span></div>
        <p class="MsoNormal"><span style="font-size: 7.5pt; font-family:
            "Arial","sans-serif"; color: gray;">CONFIDENTIALITY
            NOTICE: This email and any attachments are for the<br>
            exclusive and confidential use of the intended recipient. If
            you are not<br>
            the intended recipient, please do not read, distribute or
            take action in<br>
            reliance upon this message. If you have received this in
            error, please<br>
            notify us immediately by return email and promptly delete
            this message<br>
            and its attachments from your computer system. We do not
            waive<br>
            attorney-client or work product privilege by the
            transmission of this<br>
            message.</span><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";"><br>
            <br>
            <br>
            <o:p></o:p></span></p>
        <pre>-- <o:p></o:p></pre>
        <pre>David Baldwin - IT Unit<o:p></o:p></pre>
        <pre>Australian Sports Commission          <a moz-do-not-send="true" href="http://www.ausport.gov.au">www.ausport.gov.au</a><o:p></o:p></pre>
        <pre>Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="mailto:david.baldwin@ausport.gov.au">david.baldwin@ausport.gov.au</a>          Leverrier Street Bruce ACT 2617<o:p></o:p></pre>
        <p class="MsoNormal"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";"><o:p> </o:p></span></p>
        <div class="MsoNormal" style="text-align: center;"
          align="center"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";">
            <hr align="center" size="2" width="100%"></span></div>
        <p class="MsoNormal"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";">Keep up to
            date with what's happening in Australian sport visit <a
              moz-do-not-send="true" href="http://www.ausport.gov.au">www.ausport.gov.au</a>
            <br>
            <br>
          </span><span style="font-size: 7.5pt; font-family:
            "Arial","sans-serif";">This message is
            intended for the addressee named and may contain
            confidential and privileged information. If you are not the
            intended recipient please note that any form of
            distribution, copying or use of this communication or the
            information in it is strictly prohibited and may be
            unlawful. If you receive this message in error, please
            delete it and notify the sender.</span><span
            style="font-size: 12pt; font-family: "Times New
            Roman","serif";"> <o:p></o:p></span></p>
        <div class="MsoNormal" style="text-align: center;"
          align="center"><span style="font-size: 12pt; font-family:
            "Times New Roman","serif";">
            <hr align="center" size="2" width="100%"></span></div>
      </div>
      <p class="MsoNormal" style="margin: 0in 0in 0pt;"><span
          style="font-size: 8pt; color: gray;"></span> </p>
      <p class="MsoNormal" style="margin: 0in 0in 0pt;"><span
          style="font-size: 8pt; color: gray;"></span> </p>
      <p class="MsoNormal" style="margin: 0in 0in 0pt;"> </p>
      <p class="MsoNormal" style="margin: 0in 0in 0pt;"><span
          style="font-size: 8pt; color: gray;"><font face="Arial">This
            message is intended only for the individual or entity to
            which it is addressed.  It may contain privileged,
            confidential information which is exempt from disclosure
            under applicable laws.  If you are not the intended
            recipient, please note that you are strictly prohibited from
            disseminating or distributing this information (other than
            to the intended recipient) or copying this information.  If
            you have received this communication in error, please notify
            us immediately by e-mail or by telephone at the above
            number. Thank you. <o:p></o:p></font></span></p>
      <a moz-do-not-send="true" title="gfidisc.la-z-boy.com" href="#"> </a></blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
David Baldwin - IT Unit
Australian Sports Commission          <a class="moz-txt-link-abbreviated" href="http://www.ausport.gov.au">www.ausport.gov.au</a>
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
<a class="moz-txt-link-abbreviated" href="mailto:david.baldwin@ausport.gov.au">david.baldwin@ausport.gov.au</a>          Leverrier Street Bruce ACT 2617
</pre>
  </body>
</html>