TestimoX

API Reference

Class

CimWmiClient

Namespace ComputerX.Wmi
Assembly ComputerX
Implements
Modifiers sealed
Attributes
SupportedOSPlatform("windows")

CIM-first implementation of IWmiClient with WMI fallback.

Inheritance

  • Object
  • CimWmiClient

Constructors

public CimWmiClient() #

Methods

Query 2 overloads
public virtual IReadOnlyList<WmiRow> Query(String computer, String namespace, String query, WmiOptions options, CancellationToken ct = null) #
Returns: IReadOnlyList<WmiRow>

Executes a CIM query and returns all rows; optionally times out.

Parameters

computer System.String requiredposition: 0
Target computer name or IP.
namespace System.String requiredposition: 1
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String requiredposition: 2
WQL query text.
timeout System.Nullable{System.TimeSpan} = null requiredposition: 3
Optional per-query timeout.
ct System.Threading.CancellationToken = null optionalposition: 4
Cancellation token.
Query(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #

Executes a CIM query with options (credentials/transport) and returns rows.

Parameters

computer System.String required
Target computer name or IP.
namespace System.String required
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String required
WQL query text.
options ComputerX.Wmi.WmiOptions required
CIM/WMI options including credentials and timeout.
ct System.Threading.CancellationToken required
Cancellation token.
QueryAsync 2 overloads
public virtual Task<IReadOnlyList<WmiRow>> QueryAsync(String computer, String namespace, String query, WmiOptions options, CancellationToken ct = null) #
Returns: Task<IReadOnlyList<WmiRow>>

Executes a CIM query asynchronously and returns all rows; optionally times out.

Parameters

computer System.String requiredposition: 0
Target computer name or IP.
namespace System.String requiredposition: 1
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String requiredposition: 2
WQL query text.
timeout System.Nullable{System.TimeSpan} = null requiredposition: 3
Optional per-query timeout.
ct System.Threading.CancellationToken = null optionalposition: 4
Cancellation token.
QueryAsync(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #

Executes a CIM query asynchronously with options (credentials/transport) and returns rows.

Parameters

computer System.String required
Target computer name or IP.
namespace System.String required
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String required
WQL query text.
options ComputerX.Wmi.WmiOptions required
CIM/WMI options including credentials and timeout.
ct System.Threading.CancellationToken required
Cancellation token.
public virtual T QuerySingle<T>(String computer, String namespace, String query, Func<WmiRow, T> projector, WmiOptions options, CancellationToken ct = null) #
Returns: T

Type Parameters

T

Parameters

computer String requiredposition: 0
namespace String requiredposition: 1
query String requiredposition: 2
projector Func<WmiRow, T> requiredposition: 3
timeout Nullable<TimeSpan> = null requiredposition: 4
ct CancellationToken = null optionalposition: 5
public virtual Task<T> QuerySingleAsync<T>(String computer, String namespace, String query, Func<WmiRow, T> projector, WmiOptions options, CancellationToken ct = null) #
Returns: Task<T>

Type Parameters

T

Parameters

computer String requiredposition: 0
namespace String requiredposition: 1
query String requiredposition: 2
projector Func<WmiRow, T> requiredposition: 3
timeout Nullable<TimeSpan> = null requiredposition: 4
ct CancellationToken = null optionalposition: 5
QuerySingleAsync``1 2 overloads
QuerySingleAsync``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, System.Nullable{System.TimeSpan} timeout, System.Threading.CancellationToken ct) #

Executes a CIM query asynchronously and projects the first row (if any).

Type Parameters

T
Result type produced by the projector.

Parameters

computer System.String required
Target computer name or IP.
namespace System.String required
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String required
WQL query text.
projector System.Func{ComputerX.Wmi.WmiRow,``0} required
Projection function for the first row.
timeout System.Nullable{System.TimeSpan} required
Optional per-query timeout.
ct System.Threading.CancellationToken required
Cancellation token.
QuerySingleAsync``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #

Executes a CIM query asynchronously with options and projects the first row (if any).

Type Parameters

T
Result type produced by the projector.

Parameters

computer System.String required
Target computer name or IP.
namespace System.String required
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String required
WQL query text.
projector System.Func{ComputerX.Wmi.WmiRow,``0} required
Projection function for the first row.
options ComputerX.Wmi.WmiOptions required
CIM/WMI options including credentials and timeout.
ct System.Threading.CancellationToken required
Cancellation token.
QuerySingle``1 2 overloads
QuerySingle``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, System.Nullable{System.TimeSpan} timeout, System.Threading.CancellationToken ct) #

Executes a CIM query and projects the first row (if any).

Type Parameters

T
Result type produced by the projector.

Parameters

computer System.String required
Target computer name or IP.
namespace System.String required
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String required
WQL query text.
projector System.Func{ComputerX.Wmi.WmiRow,``0} required
Projection function for the first row.
timeout System.Nullable{System.TimeSpan} required
Optional per-query timeout.
ct System.Threading.CancellationToken required
Cancellation token.
QuerySingle``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #

Executes a CIM query with options and projects the first row (if any).

Type Parameters

T
Result type produced by the projector.

Parameters

computer System.String required
Target computer name or IP.
namespace System.String required
CIM namespace (e.g., root/cimv2 or root\\cimv2).
query System.String required
WQL query text.
projector System.Func{ComputerX.Wmi.WmiRow,``0} required
Projection function for the first row.
options ComputerX.Wmi.WmiOptions required
CIM/WMI options including credentials and timeout.
ct System.Threading.CancellationToken required
Cancellation token.