API Reference
Class
WmiClient
Classic WMI-based IWmiClient using System.Management.
Inheritance
- Object
- WmiClient
Constructors
public WmiClient() #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 WMI query and returns all rows.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- timeout System.Nullable{System.TimeSpan} = null
- Optional per-query timeout.
- ct System.Threading.CancellationToken = null
- Cancellation token.
Query(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Executes a WMI query with advanced options (credentials/timeout).
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- options ComputerX.Wmi.WmiOptions
- Optional WMI options including credentials and timeout.
- ct System.Threading.CancellationToken
- 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 WMI query asynchronously and returns all rows.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- timeout System.Nullable{System.TimeSpan} = null
- Optional per-query timeout.
- ct System.Threading.CancellationToken = null
- Cancellation token.
QueryAsync(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Executes a WMI query asynchronously with explicit options.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- options ComputerX.Wmi.WmiOptions
- Optional WMI options including credentials and timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
public virtual T QuerySingle<T>(String computer, String namespace, String query, Func<WmiRow, T> projector, WmiOptions options, CancellationToken ct = null) #Returns:
TType Parameters
- T
Parameters
- computer String
- namespace String
- query String
- projector Func<WmiRow, T>
- timeout Nullable<TimeSpan> = null
- ct CancellationToken = null
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
- namespace String
- query String
- projector Func<WmiRow, T>
- timeout Nullable<TimeSpan> = null
- ct CancellationToken = null
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 WMI query asynchronously and projects the first row (if any).
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- timeout System.Nullable{System.TimeSpan}
- Optional per-query timeout.
- ct System.Threading.CancellationToken
- 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 WMI query asynchronously with options and projects the first row (if any).
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- options ComputerX.Wmi.WmiOptions
- Optional WMI options including credentials and timeout.
- ct System.Threading.CancellationToken
- 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 WMI query and projects the first row (if any).
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- timeout System.Nullable{System.TimeSpan}
- Optional per-query timeout.
- ct System.Threading.CancellationToken
- 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 WMI query with options and projects the first row (if any).
Type Parameters
- T
- Result type produced by the projector.
Parameters
- computer System.String
- Target computer name or IP.
- namespace System.String
- WMI namespace (e.g., root\\cimv2).
- query System.String
- WQL query text.
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- Projection function for the first row.
- options ComputerX.Wmi.WmiOptions
- Optional WMI options including credentials and timeout.
- ct System.Threading.CancellationToken
- Cancellation token.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object
Properties
public static TimeSpan DefaultTimeout { get; set; } #Default timeout applied to WMI queries when an explicit timeout is not provided.