<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
        {font-family:"Times New Roman \, serif \;";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* 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;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle31
        {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]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'> </span><span style='color:#1F497D'>David,</span><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>First, the services information is unreliable.  This can fix that, if we can make it work.  </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>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><br><o:p></o:p></span></p><p class=MsoNormal><b><i><span style='color:#1F497D'>[Scot Kreienkamp] <o:p></o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'>As long as the service shows the executable name I don't think the PID is required, and it's not shown now anyway.  The pertinent information is Name, Start type, Status, and DisplayName.  The PID can be found by using the EXE name on the CPU page if one needed that information.  <o:p></o:p></span></i></b></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>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. </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>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><br><o:p></o:p></span></p><p class=MsoNormal><b><i><span style='color:#1F497D'>[Scot Kreienkamp] <o:p></o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'>So what can we do to lower the load?  The only other suggestion I have is the WMI calls.  </span></i></b><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>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:</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>get-Process  -id $PID | foreach {$_.PriorityClass= [System.Diagnostics.ProcessPriorityClass]::Idle}</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>I can add an option to set the priority of the client at startup.</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><b><i><span style='color:#1F497D'>[Scot Kreienkamp] <o:p></o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'>Great!<o:p></o:p></span></i></b></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>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.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>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></span><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><b><i><span style='color:#1F497D'>[Scot Kreienkamp] <o:p></o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'>I'm not excited about it either.  Actually, I've given up on it.  I'm not a programmer;  Its over my head.  <o:p></o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'><o:p> </o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'>Just out of curiosity I rewrote the services piece in AutoIt because I can easily tap into DLL's.  I know you don't want to branch things like that off to yet another technology, I just did it out of curiosity to see the difference between using .Net and WMI.  It was a considerable difference. Not only was it much faster, but the CPU load was significantly less.  If that holds true across the board, anything that could easily be moved off WMI calls to .Net calls would show a considerable return.  <o:p></o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'><o:p> </o:p></span></i></b></p><p class=MsoNormal><b><i><span style='color:#1F497D'>Thanks for being open minded and willing to take suggestions.  </span></i></b><b><i><span style='font-family:Wingdings;color:#1F497D'>J</span></i></b><b><i><span style='color:#1F497D'><o:p></o:p></span></i></b></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> </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></div><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color -moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> David Baldwin [<a 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 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>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 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 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 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:#1F497D'>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 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 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:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Ray</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Scot Kreienkamp [<a 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 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:#1F497D'>This is what I have so far:</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>function XymonSvcsNET2</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>{</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $result = [reflection.Assembly]::LoadWithPartialName("System.ServiceProcess")</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $Services = [System.ServiceProcess.ServiceController]::GetServices()</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $COLUMNNAME="Name"</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $COLUMNSTATUS="Status"</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $COLUMNDESCRIPTION="Description"</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                #[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:#1F497D'>                #get all the services installed on the local machine</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $serviceController = [System.ServiceProcess.ServiceController]::GetServices()</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                "[svcs]"</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                "--------------------------------------------------------------------------------------------------------------"</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                "{0,-50} {1,-20} {2,-20}" -f `</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $COLUMNNAME, $COLUMNSTATUS, $COLUMNDESCRIPTION</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                "--------------------------------------------------------------------------------------------------------------"</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                foreach ($svc in $serviceController) {</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                "{0,-50} {1,-20} {2,-20}" -f `</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                $svc.Name, $svc.Status, $svc.DisplayName</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                }</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>}</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>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:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>I'm a complete newbie at powershell, so comments/help appreciated.  </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </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 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:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:xymon-bounces@xymon.com">xymon-bounces@xymon.com</a> [<a 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 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:#1F497D'>David, you can also use the “Load” method instead as follows:</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>[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:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'><br>Ray</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> David Baldwin [<a 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 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 lang=EN-AU style='color:#1F497D'>Ray,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-AU style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-AU style='color:#1F497D'>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 lang=EN-AU style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-AU style='color:#1F497D'>I’m offsite this week, will try to take a look next week.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-AU style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-AU style='color:#1F497D'>Thanks, David.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-AU style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Scot Kreienkamp [<a 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 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:#1F497D'>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:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>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:#1F497D'> </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 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:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Storer, Raymond [<a 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 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:#1F497D'>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:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>[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:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Ray</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:xymon-bounces@xymon.com">xymon-bounces@xymon.com</a> [<a 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 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:#1F497D'>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:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'># your path to the file may very</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>[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:#1F497D'>#get all the services installed on the local machine</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>$serviceController = [System.ServiceProcess.ServiceController]::GetServices()</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>foreach ($svc in $serviceController) {</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                # should indicate: Stopped, Running, or Paused … others???</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                write-host $svc.Status</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                # the service name</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                write-host $svc.Name</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                # the service display name</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>                write-host $svc.DisplayName</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>}</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>Ray</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'>[snip]</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Arial","sans-serif";color:gray'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:windowtext'> </span><o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:windowtext'><hr size=2 width="100%" align=center></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:8.0pt;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:12.0pt;font-family:"Times New Roman","serif"'> </span><o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><hr size=2 width="100%" align=center></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><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><br><br></span><o:p></o:p></p><pre>-- <o:p></o:p></pre><pre>David Baldwin - IT Unit<o:p></o:p></pre><pre>Australian Sports Commission          <a 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 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:12.0pt;font-family:"Times New Roman","serif"'> </span><o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><hr size=2 width="100%" align=center></span></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Keep up to date with what's happening in Australian sport visit <a 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:12.0pt;font-family:"Times New Roman , serif ;","serif"'> </span><o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><hr size=2 width="100%" align=center></span></div><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:8.0pt;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:12.0pt;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 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 href="mailto:david.baldwin@ausport.gov.au">david.baldwin@ausport.gov.au</a>          Leverrier Street Bruce ACT 2617<o:p></o:p></pre></div><FONT face=Tahoma size=2><FONT color=#0000ff></FONT></FONT>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 8pt; COLOR: gray"><FONT face=Arial></FONT></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 8pt; COLOR: gray"><FONT face=Arial></FONT></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. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P><A title="gfidisc.la-z-boy.com" href="#">  </A></body></html>