Windows update service state running or stopped

I would like to find windows update service status in analysis whether it’s running or stopped.

Currently i tried this but not working.

(if (it = "Running") then ("Running") else (if (it = "Stopped") else ERROR "Value not recognized")))) of service "wuauserv"

I definitely missed something in there or may be the whole thing is wrong. Please help.

@JasonWalker @jgstew @strawgate @cjwolford @AlexaVonTess @TimRice @Aram @Pete_F @Nagaraj

Please don’t mention a bunch of people on your posts – it’s annoying to the very people who will probably end up helping you anyway.

state of service "wuauserv" is all you need

7 Likes

Noted.

And thank you that worked.

Could this kind of example make its way to developer.bigfix.com?

If you look at the example for service
https://developer.bigfix.com/relevance/reference/service.html

It uses the relay service, but the format you used was
service “quoted_servicename”

Updates to the documentation pages would be very useful.

Although there is no example provided, the documentation does show the approach that @strawgate used to create a service object in relevance:

service <string> : service
Returns the service object matching the name provided, regardless of its running state.

There are many instances of relevance object creation that use the format <object name> <string>.

This is true, but if you take a literal approach to that documentation you end up with:

service servicename
or
servicename service

Neither of which works.

q: windefend service
E: The operator "windefend service" is not defined.

q: service windefend
E: The operator "service windefend" is not defined.

q: state of windefend service
E: The operator "windefend service" is not defined.

q: state of service windefend
E: The operator "service windefend" is not defined.

You can absolutely find examples through searching in the forums, but updates to the relevance documentation that provide better functional examples would reduce questions and the need to spend hours hunting for the right contortion of how to put the relevance together.

One of the great values of the C3 sites (separate thread) is that it has a lot of well written relevance examples that are not obvious based on the documentation.

True enough. The thing to remember is that strings in relevance have to be quoted, when entered as literal values, or derived from the property of another object that returns a string.

1 Like