digger
digger

Reputation: 55

Wmic ,all of the valid clause behind the where keyword

I want to know the all of the valid clauses behind where keyword about wmic command.

Wmic nicconfig where DefaultIPGateway!='' get description

The above command sentence show me an error message description = invalid query

I suspect that the DefaultIPGateway is not a valid clause. So how to get the all of the valid clauses behind the where keyword.

I did the following tries.

Wmic alias get pwhere

Upvotes: 2

Views: 3946

Answers (1)

JosefZ
JosefZ

Reputation: 30123

Full list of the WQL keywords: WQL (SQL for WMI).

Win32_NetworkAdapterConfiguration class:

DefaultIPGateway

Data type: string array
Access type: Read-only
Qualifiers: MappingStrings ("Win32Registry|System\CurrentControlSet\Services|Parameters|DefaultGateway")

Array of IP addresses of default gateways that the computer system uses.

Querying with WQL:

The WMI Query Language (WQL) is a subset of standard American National Standards Institute Structured Query Language (ANSI SQL) with minor semantic changes to support WMI.

Note WQL does not support queries of array datatypes.

Corollary: you cannot constitute a valid WHERE clause to narrow the wmic output by DefaultIPGateway data.
Please read http://ss64.com/nt/wmic.html to see some valid WHERE clause examples used in wmic command.

However, you can still get desired info using find or findstr commands, for instance as follows:

==> Wmic nicconfig get DefaultIPGateway, description | find "{"
{"192.168.11.1"}   Realtek PCIe GBE Family Controller

Upvotes: 1

Related Questions