Does anyone know if the services inspector for Windows allows you to see dependencies, e.g., if servicea is dependent on serviceb, I could see that using the inspector.
@jbruns2017 I donât see a Property of the <service>
inspector.
You might be able to see them with a registry query:
Example, for BITS service:
q: value "DependOnService" of key (service name of service "bits" as string) of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" of native registry
A: RpcSs%00%00
I looked at bits and see 3 services it depends on, so I wonder if there are other registry keys.
Here is a Powershell way to get what a service is dependent on and what services are dependent on it.
âŚfind the services that must be running before I can start the service?
$name = âBrokerInfrastructureâ
$query = (âAssociators of {Win32_Service.Name=â + [char]34+$name+[char]34+â} Where AssocClass=Win32_DependentService Role=Dependentâ)
Get-WmiObject -Query $query -Namespace âroot\cimv2â | format-list Name, DisplayName
.find the services that require the service to be running before they can start?
$name = âBrokerInfrastructureâ
$query = (âAssociators of {Win32_Service.Name=â + [char]34+$name+[char]34+â} Where AssocClass=Win32_DependentService Role=Antecedentâ)
Get-WmiObject -Query $query -Namespace âroot\cimv2â | format-list Name, DisplayName
I see the registry key you used is a multi-string type.
Maybe another option using @brolly33 approach
Q: display names of services (substrings separated by "%00" of (preceding texts of last "%00%00" of (values "DependOnService" of key (service name of service "BrokerInfrastructure" as string) of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" of native registry as string)) as string as trimmed string)
A: RPC Endpoint Mapper
A: DCOM Server Process Launcher
A: Remote Procedure Call (RPC)
T: 200.476 ms
I: plural string
Generally, the service inspectors have a lot of room for improvement to be desired! I already have one RFE (the Windows inspector doesnât differentiate between different âAutomaticâ start-ups - Auto, Auto-Delayed, Auto-Triggered) and had submitted a few complaints on Linux/Unix as those are significantly more deficient (it cannot even capture âstateâ on Linux, so you have to look up processes as workaround; it cannot capture âstart upâ at all which does exist on Linux OS and I havenât been able to find a direct relevance workaround at all; etc).Even the service-side Linux/Unix Compliance checks coming from HCL require you to run actions that output to file which then checks read back all which would be a LOT simpler if only there were working inspectors that are even âon-parâ with WindowsâŚ
Thank you for the IDEA.
I also think the Windows services
inspector should differentiate the different subtypes of Start Type
.
@SLB
I love that you took the registry workaround and converted it back into services
objects. That was slick.
Itâs a little tricky, but I think we can modularize that relevance, so itâs more like <property> of <object>
q: (services(( substrings separated by "%00" of preceding texts of last "%00%00" of (it as string) of values "DependOnService" of item 0 of it) of (keys of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" of native registry, it) whose (name of item 0 of it as string as lowercase = service name of item 1 of it as string as lowercase) as string)) of service "BrokerInfrastructure"
A: "RpcEptMapper" "RPC Endpoint Mapper" "Running"
A: "DcomLaunch" "DCOM Server Process Launcher" "Running"
A: "RpcSs" "Remote Procedure Call (RPC)" "Running"
I may actually need to submit RFEs for start type of service & state of service for Linux.
@jbruns2017 I hope the workaround relevance helped you for your immediate needs.
To the longer term enhancement, could I ask your favor in two small tasks?
Could I ask you to go vote for the Idea that @ageorgiev opened that requests this enhancement
Could you also please add your âuse caseâ into the comments in the Idea?
It really helps the development team make their decisions on what to work on next when they can see how the enhancement will serve your IT needs and they can see how many votes an idea has.
I voted it up and added comments.
Created the RFE for the inspectors on Unix/Linux as well now: BFP-I-207.