Right-Click to restart Bigfix client service

(imported topic written by Shlomi91)

Hi,

i am trying to figure out a way to add a right-click option to restart the “besclient” service.

problem 1: you can only enter one line under “ShellCommandRelevance”, this rules out the use of “sc” and “net” commands - i need “restart”, these only offer “stop” and “start”.

solution 1: i am only running this against Windows 7, so i can use Powershell, using this command:

powershell restart-service -inputobject $(get-service -computername pc1234 -name besclient) -verbose

this is working great from CMD, but this brings me to:

problem 2: i need to substitute “pc1234” with "( values of property results whose (name of property of it = “IP Address” ) of current computer) ".

i tried several combinations, none of these worked.

anyone have an idea to either fix this substitution problem, or restart the besclient using right-click in another method?

thanks,

Shlomi

(imported comment written by cwmenard)

You’ll probably need to just create a .ps1 and call it from the registry.

then you could use variables such as:

$computername = $($args[0])

restart-service -inputobject $(get-service -computername $computername -name besclient) -verbose

In the registry you might use something like:

"Powershell -file \path\to\my.ps1 " & name of current computer

(imported comment written by SystemAdmin)

We have resorted to a homemade health check script that is scheduled in the local task scheduler of each client. It runs daily. If all is healthy, it doesn’t do anything. If an issue is detected, it will cycle the client service and/or clear corrupt client metadata (most common issue).