abel5405 Absent Member.
Absent Member.
1868 views

Help with the PowerShell Run Command Script

Greetings all,
I'm trying to use the PowerShell Run Command Script to collect service status information but I can't seem to get it to do what I want and could use a little help. The command I am running is "Get-CimInstance -ClassName Win32_Service -Filter "Startmode='Auto'" | Select-Object Name,@{n="Started";e={[int]$_.Started}}" and I am trying to collect data on it. Service started is 1 and stopped is 0.

Basically the end result is I need to build a report around a group of services on select services to list them as running/stopped. I'm doing this in SSRS. I tried using the NT_ServiceDown script but it collects data on all services, not just the ones set to automatic, (I just put a support request in on that).

If I could get the PS script to collect that data that would be great. Any help would be greatly appreciated. Hope I make sense here in what I am trying to do.

v/r
Chris
Tags (1)
0 Likes
3 Replies
AutomaticReply Absent Member.
Absent Member.

Re: Help with the PowerShell Run Command Script

abel5405,

It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.

These forums are peer-to-peer, best effort, volunteer run and that if your issue
is urgent or not getting a response, you might try one of the following options:

- Visit https://www.microfocus.com/support-and-services and search the knowledgebase and/or check
all the other self support options and support programs available.
- Open a service request: https://www.microfocus.com/support
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.microfocus.com)
- You might consider hiring a local partner to assist you.
https://www.partnernetprogram.com/partnerfinder/find.html

Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.microfocus.com/faq.php

Sometimes this automatic posting will alert someone that can respond.

If this is a reply to a duplicate posting or otherwise posted in error, please
ignore and accept our apologies and rest assured we will issue a stern reprimand
to our posting bot.

Good luck!

Your Micro Focus Forums Team
http://forums.microfocus.com



0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Help with the PowerShell Run Command Script

Chris--

The PowerShell command you are provide is returning status based on all services set to Automatic. The NT_ServiceDown *does* provide this capability. If you enter an asterisk/star in the Services to monitor field then choose Automatic in the Service start-type filter.



Regarding the issue with the PowerShell command provided and the PowerShell_RunCommand KS, the KS is designed to only collect data for a single metric.

Let me know if you have any further questions and/or issues.

Thanks,
Ethan
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Help with the PowerShell Run Command Script

Not sure why they give you the option to "Insert Image" on the forums if it doesn't actually insert the image file!! Here is a link for reference: https://microfocuscc-my.sharepoint.com/:i:/g/personal/ethan_itom_solutions/Ebwb8vV6ewJMqC1QRg28p8EBSyAcgjpzNTPJl-gETfu3OA?e=UO578c
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.