[Xymon] Windows PS client svcs data missing
Scot Kreienkamp
SKreien at la-z-boy.com
Wed Jun 1 14:44:39 CEST 2011
Raymond,
I'm trying to implement the code you sent… or at least trying to muddle through it. I've never attempted anything in powershell until now.
I have two questions that I'm hoping you can help with… I can't find any way to get the startup setting, IE whether it's automatic, manual, etc. Also, I'm struggling trying to line up the columns in the output. Any clues you can give me on both would be appreciated.
Scot Kreienkamp
Senior Systems Engineer
skreien at la-z-boy.com
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Storer, Raymond
Sent: Monday, May 16, 2011 10:38 AM
To: David Baldwin
Cc: xymon at xymon.com
Subject: Re: [Xymon] Windows PS client svcs data missing
David, you can also use the “Load” method instead as follows:
[Reflection.Assembly]::Load(‘System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’)
Ray
From: David Baldwin [mailto:David.Baldwin at ausport.gov.au]
Sent: Monday, May 16, 2011 12:39 AM
To: 'Scot Kreienkamp'; Storer, Raymond
Cc: xymon at xymon.com
Subject: RE: [Xymon] Windows PS client svcs data missing
Ray,
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?
I’m offsite this week, will try to take a look next week.
Thanks, David.
From: Scot Kreienkamp [mailto:SKreien at la-z-boy.com]
Sent: Saturday, 14 May 2011 5:54 AM
To: Storer, Raymond; David Baldwin
Cc: xymon at xymon.com
Subject: RE: [Xymon] Windows PS client svcs data missing
Thank you Raymond… If I knew how to implement it I would. Hopefully David or Henrik can find the time to experiment with it.
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.
Scot Kreienkamp
Senior Systems Engineer
skreien at la-z-boy.com
From: Storer, Raymond [mailto:storerr at nibco.com]
Sent: Friday, May 13, 2011 12:58 PM
To: David Baldwin; Scot Kreienkamp
Cc: xymon at xymon.com
Subject: RE: [Xymon] Windows PS client svcs data missing
Opps… I missed the “.” in the [Reflection.Assembly]. Also, you can pipe it to out-null to avoid any unwanted output. So:
[Reflection.Assembly]::LoadFile(‘C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\System.ServiceProcess.dll’) | out-null
Ray
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Storer, Raymond
Sent: Friday, May 13, 2011 11:40 AM
To: David Baldwin; Scot Kreienkamp
Cc: xymon at xymon.com
Subject: Re: [Xymon] Windows PS client svcs data missing
Scot and David, if you’d prefer to implement a .net pure call for services you can try the following:
# your path to the file may very
[ReflectionAssembly]::LoadFile(‘C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\System.ServiceProcess.dll’)
#get all the services installed on the local machine
$serviceController = [System.ServiceProcess.ServiceController]::GetServices()
foreach ($svc in $serviceController) {
# should indicate: Stopped, Running, or Paused … others???
write-host $svc.Status
# the service name
write-host $svc.Name
# the service display name
write-host $svc.DisplayName
}
Ray
[snip]
________________________________
CONFIDENTIALITY NOTICE: This email and any attachments are for the
exclusive and confidential use of the intended recipient. If you are not
the intended recipient, please do not read, distribute or take action in
reliance upon this message. If you have received this in error, please
notify us immediately by return email and promptly delete this message
and its attachments from your computer system. We do not waive
attorney-client or work product privilege by the transmission of this
message.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20110601/568b4c9f/attachment.html>
More information about the Xymon
mailing list