Topic
• 2 replies
• Latest Post - ‏2013-03-20T14:12:48Z by SystemAdmin
Shlomi91
5 Posts

# Pinned topic Right-Click to restart Bigfix client service

‏2013-01-24T12:46:16Z |
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 • cwmenard 1 Post #### Re: Right-Click to restart Bigfix client service ‏2013-02-04T17:05:08Z 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
104 Posts

#### Re: Right-Click to restart Bigfix client service

‏2013-03-20T14:12:48Z
• cwmenard
• ‏2013-02-04T17:05:08Z
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
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).