API Reference
ServicesQuery
Provides service management queries.
Inheritance
- Object
- ServicesQuery
Constructors
public ServicesQuery() #Methods
public Boolean AreServicesRunning(String[] serviceNames, String[] machineNames = null, InternalLogger logger = null) #BooleanSynchronous wrapper for [[cref:ComputerX.Services.ServicesQuery.AreServicesRunningAsync(System.String[],System.String[],ComputerX.Logging.InternalLogger)]].
Parameters
- serviceNames System.String[]
- machineNames System.String[] = null
- logger ComputerX.Logging.InternalLogger = null
public async Task<Boolean> AreServicesRunningAsync(String[] serviceNames, String[] machineNames = null, InternalLogger logger = null) #Task<Boolean>Returns true when all specified services are running on each target machine.
Parameters
- serviceNames System.String[]
- Service names to verify.
- machineNames System.String[] = null
- Optional list of machines; defaults to local.
- logger ComputerX.Logging.InternalLogger = null
- Optional logger.
public Boolean EnsureServicesRunning(String[] serviceNames, String[] machineNames = null, InternalLogger logger = null) #BooleanSynchronous version of [[cref:ComputerX.Services.ServicesQuery.EnsureServicesRunningAsync(System.String[],System.String[],ComputerX.Logging.InternalLogger)]].
Parameters
- serviceNames System.String[]
- machineNames System.String[] = null
- logger ComputerX.Logging.InternalLogger = null
public Task<Boolean> EnsureServicesRunningAsync(String[] serviceNames, String[] machineNames = null, InternalLogger logger = null) #Task<Boolean>Ensures that the specified services are running on each target machine by querying their status.
Parameters
- serviceNames System.String[]
- Service names to validate.
- machineNames System.String[] = null
- Optional list of machines; defaults to the local machine.
- logger ComputerX.Logging.InternalLogger = null
- Optional logger for diagnostics.
Returns
True when every named service is in the Running state on all targets.
GetServiceStartupType(System.ServiceProcess.ServiceController arg1, ComputerX.Logging.InternalLogger arg2) #Determines the service startup type using native SCM first, then falls back to local registry or WMI when necessary.
Parameters
- arg1 System.ServiceProcess.ServiceController
- arg2 ComputerX.Logging.InternalLogger
public Task<List<ServiceInfo>> QueryAllAsync(String[] machineNames = null, InternalLogger logger = null) #Task<List<ServiceInfo>>Queries all services on one or more machines.
Parameters
- machineNames System.String[] = null
- logger ComputerX.Logging.InternalLogger = null
public Task<List<ServiceInfo>> QueryAllAsync(String[] machineNames = null, Nullable<TimeSpan> perMachineTimeout = null, CancellationToken ct = null, InternalLogger logger = null, Boolean includeDetails = true) #Task<List<ServiceInfo>>Queries all services on one or more machines with optional per‑machine timeout and cancellation.
Parameters
- machineNames System.String[] = null
- Machines to query; defaults to local machine.
- perMachineTimeout System.Nullable{System.TimeSpan} = null
- Optional timeout per machine; empty for no timeout.
- ct System.Threading.CancellationToken = null
- Cancellation token.
- logger ComputerX.Logging.InternalLogger = null
- Optional logger.
- includeDetails System.Boolean = true
- When true, attempts to enrich with WMI details.
public async Task<List<ServiceInfo>> QueryAllViaCimAsync(String[] machineNames = null, InternalLogger logger = null) #Task<List<ServiceInfo>>Query all services using CIM.
Parameters
- machineNames System.String[] = null
- logger ComputerX.Logging.InternalLogger = null
public Task<List<ServiceInfo>> QueryAllViaWmiAsync(String[] machineNames = null, InternalLogger logger = null) #Task<List<ServiceInfo>>Query all services using WMI.
Parameters
- machineNames System.String[] = null
- logger ComputerX.Logging.InternalLogger = null
public List<ServiceInfo> QueryServices(String[] serviceNames, String[] machineNames = null, InternalLogger logger = null) #List<ServiceInfo>Synchronous wrapper for [[cref:ComputerX.Services.ServicesQuery.QueryServicesAsync(System.String[],System.String[],ComputerX.Logging.InternalLogger)]].
Parameters
- serviceNames System.String[]
- machineNames System.String[] = null
- logger ComputerX.Logging.InternalLogger = null
public async Task<List<ServiceInfo>> QueryServicesAsync(String[] serviceNames, String[] machineNames = null, InternalLogger logger = null) #Task<List<ServiceInfo>>Queries the specified services on one or more machines and returns their status/info.
Parameters
- serviceNames System.String[]
- Service names to query.
- machineNames System.String[] = null
- Optional list of machines; defaults to local machine.
- logger ComputerX.Logging.InternalLogger = null
- Optional logger for diagnostics.
public IAsyncEnumerable<ServiceInfo> QueryServicesAsyncEnumerable(String[] serviceNames, IEnumerable<String> machineNames = null, Int32 degreeOfParallelism = 4, CancellationToken cancellationToken = null, InternalLogger logger = null) #IAsyncEnumerable<ServiceInfo>Streams service info for the specified services across many machines with bounded parallelism.
Parameters
- serviceNames System.String[]
- machineNames System.Collections.Generic.IEnumerable{System.String} = null
- degreeOfParallelism System.Int32 = 4
- cancellationToken System.Threading.CancellationToken = null
- logger ComputerX.Logging.InternalLogger = null
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object