Does anyone know if there is a way of disabling multiple Windows Services in the registry at once by either using the Registry Task Wizard or would this need to be done by a custom task?
Basically the goal here is to limit the amount of steps needed in an automation plan.
Does it have to go through the registry? The SC command could help with this. For example you could run sc config servicehere start= disabled | net stop servicehere
@MMosley Spot on suggestion. Use the Windows commands over hacking the registry.
To add on, since you need to disable multiple services, you will probably need to create a bat file using __createfile command and then run the bat file in your action script, similar to what we did here with changing user group configurations:
No, it doesn’t have to be through the registry. Whatever is quickest honestly - we have a fairly large automation plan this needs to be placed into. So you can have multiples in your example? Such as:
sc config servicehere start= disabled | net stop servicehere
sc config servicehere2 start= disabled | net stop servicehere2
sc config servicehere3 start= disabled | net stop servicehere3
that will work as well. Your ActionScript could be as simple as:
dos sc config servicehere start= disabled
dos net stop servicehere
dos sc config servicehere1 start= disabled
dos net stop servicehere1
dos sc config servicehere2 start= disabled
dos net stop servicehere2
thank you very much for the replies. I tested the above and it worked perfectly. However, I also need to re-enable the services afterwards in the automation plan. Setting the services back to automatic or manual did not appear to work even though the task shows a status of completed. Any idea why that might be?
EDIT: I was able to get them re-enabled to automatic just not manual.
Revisiting this. As I said before, I was able to get this to work fine and had figured out the start types.
I placed this in an automation plan (unsure if the outcome is different because of that?) with a failure step to stop the plan if it fails. Fixlet content below:
Relevance
(windows of operating system) AND (exists running service “TraceMasterVue SQL Security Service” OR exists running service “TraceMasterVue Communications Service” OR exists running service “TraceMasterVue IO proxy Service” OR exists running service “traceMasterVue service manager” OR exists running service “TraceMasterVue Status Manager”)
Actions
Action1 (default)
Script Type BigFix Action Script
// Enter your action script here
dos sc config TraceMasterVue SQL Security Service start= disabled
dos net stop "TraceMasterVue SQL Security Service"
dos sc config TraceMasterVue Communications Service start= disabled
dos net stop "TMVCommService"
dos sc config TraceMasterVue IO Proxy Service start= disabled
dos net stop "TraceMasterVue IO Proxy Service"
dos sc config TraceMasterVue Service Manager start= disabled
dos net stop "TraceMasterVue Service Manager"
dos sc config TraceMasterVue Status Manager start= disabled
dos net stop “TraceMasterVue Status Manager”
The step is saying it completes (confirmed in logs) however the plan stops. In my initial run, I did not use the quotes around the service names and the services did not stop or get set to disabled. I realized that because the service names have spaces, they probably needed quotes. After attempting that edit on the second run, the services stopped, however they did not get disabled. Puzzled as to why that did not happen. Any insight would be greatly appreciated.
Thanks, this did work, but the automation plan still stops after this step. Again, step says complete, logs show no errors so something is triggering the failure step to stop the automation plan. I attempted to wrap the commands in if statements but that yielded the same result.
Is this a Task or a Fixlet, and what Relevance are you using for this this step?
If it’s a Fixlet, it will (by default) be marked as Failed if the relevance still evaluates True after it runs. So, for example, if you’re checking whether the services exist in the Relevance, well…they still exist after you stop and disable them, so that would still evaluate True and mark the fixlet as Failed.
Relevance
(windows of operating system) AND (exists running service “TraceMasterVue SQL Security Service” OR exists running service “TraceMasterVue Communications Service” OR exists running service “TraceMasterVue IO Proxy Service” OR exists running service “TraceMasterVue Service Manager” OR exists running service “TraceMasterVue Status Manager”)
I’ve seen the targeted servers disappear from the applicable computers list under this Task after the step is completed in the automation plan.
We might need to see some of the automation plan logs to see what’s happening. Since the task is marked successful, I wonder if the next steps in the plan are relevant ?
Next step is a baseline. Support said I should enable debug logging, run the plan again and then send them the plan logs. Where are the plan logs located?