Managed property for Service?

(imported topic written by RobertDiRosato)

Is is possible to write a relevance statement for a service?

I would like to poll my servers to see if

“World Wide Web Publishing Service” is running & what is the start up type.

Thanks in advance for your help

(imported comment written by NoahSalzman)

I’m going to play “bad cop” on this one and say that you should Google:

site:forum.bigfix.com service startup type

:wink:

(imported comment written by RobertDiRosato)

I usually do search first…

I tried the below and they did not work so now I post here…

I’d appreciate any help…

if (exists service “Windows Time”) then (Status of service “Windows Time”) else “N/A”

if (exists service “Windows Time”) then (Start Type of service “Windows Time”) else “N/A”

if (exists service “Windows Time”) then State of service “Windows Time” else “N/A”

if (exists service “Windows Time”) then (state of service “Windows Time”) else (“Not Installed”)

(imported comment written by NoahSalzman)

You were close. Here’s a bunch of examples:

q: service “W32Time”

A: “W32Time” “Windows Time” “Running”

T: 0.150 ms

q: services whose (display name of it as string contains “Windows”)

A: “AudioEndpointBuilder” “Windows Audio Endpoint Builder” “Stopped”

A: “Audiosrv” “Windows Audio” “Stopped”

A: “EventLog” “Windows Event Log” “Running”

A: “FontCache” “Windows Font Cache Service” “Running”

A: “FontCache3.0.0.0” “Windows Presentation Foundation Font Cache 3.0.0.0” “Stopped”

A: “idsvc” “Windows CardSpace” “Stopped”

A: “MpsSvc” “Windows Firewall” “Running”

A: “msiserver” “Windows Installer” “Stopped”

A: “TrustedInstaller” “Windows Modules Installer” “Stopped”

A: “W32Time” “Windows Time” “Running”

A: “WcsPlugInService” “Windows Color System” “Stopped”

A: “Wecsvc” “Windows Event Collector” “Stopped”

A: “WerSvc” “Windows Error Reporting Service” “Running”

A: “Winmgmt” “Windows Management Instrumentation” “Running”

A: “WinRM” “Windows Remote Management (WS-Management)” “Running”

A: “wuauserv” “Windows Update” “Running”

A: “wudfsvc” “Windows Driver Foundation - User-mode Driver Framework” “Stopped”

T: 0.261 ms

q: (display name of it, start type of it, state of it, running of it) of services whose (display name of it is “Windows Time”)

A: Windows Time, auto, Running, True

T: 72.405 ms

q: properties whose (it as string contains “”)

A: service name of : string

A: display name of : string

A: state of : string

A: can interact with desktop of : boolean

A: win32 exit code of : integer

A: service specific exit code of : integer

A: checkpoint of : integer

A: login account of : string

A: start type of : string

A: image path of : string

A: file of : file

A: version of : version

A: win32 type of : boolean

A: driver type of : boolean

A: running of : boolean

A: security descriptor of : security descriptor

(imported comment written by RobertDiRosato)

Still can’t get this…

So back to my original question

Is it possible to get 2 separate statements

1 - Start up Type

2 - Status

Of the service

“World Wide Web Publishing Service”

I tried a bunch of statements none of which work…

state of service “World Wide Web Publishing Service” | “Not Installed”

Even tried this for the Server service

service “Server”

no luck… any help would be appreciated

(imported comment written by NoahSalzman)

In the Fixlet debugger run “services” and note that the Display Name is different than the Service name.

In my example above you can see that the Service name for Windows Time is “W32Time” but the Display Name is “Windows Time”.

This means that

service “Windows Time”

will fail and

service “W32Time”

will work.

Without seeing the results of your

services

query I do not know if the Display Name for your service is indeed “World Wide Web Publishing Service” but, if it is, then this would work:

state of service whose (display name of it = “World Wide Web Publishing Service” | “Not Installed”

But it’s probably simpler to get the Service name and use that without the whose clause.

Q: service “Windows Time”

E: Singular expression refers to nonexistent object.

Q: service “W32Time”

A: “W32Time” “Windows Time” “Running”

T: 0.177 ms

q: service whose (display name of it = “Windows Time”)

A: “W32Time” “Windows Time” “Running”

T: 72.812 ms

(imported comment written by NoahSalzman)

Typo corrected:

state of service whose (display name of it = “World Wide Web Publishing Service”) | “Not Installed”

(imported comment written by RobertDiRosato)

Noah,

Thanks again…

I appreciate your help…

I was in a meeting with a few IBM guys last week… and was telling them how I use this site for answers…

I told them how you help me out and asked if they knew you… (thinking they wouldn’t)… And all 4 of them knew who you were…

(imported comment written by NoahSalzman)

Glad to be of help.

If those guys say I still owe them money it’s all a lie.