Skip to content

Styxer/Kexla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kexla

Getting Started

Nuget Nuget

Kexla is available via NuGet.

Whats new 0.5.5

Added an option to directly use a string query at C# WMISearcher.Query

for example

var networkQuery = CimV2searcher.Query<NetworkAdapter>("SELECT * FROM Win32_NetworkAdapter");

Whats new 0.5

Added new constructors that enables running queries on remore computers you can now use any combination of

hostname | Authentication Level | domain | user name | password

to create queries on remote computers

for example

var CimV2searcher = new WMISearcher(scope: "root\\CimV2", hostname: "W2019SRV-DEV", username: "Admin", password: "pass123");

How to Use

A - Query The Data
  1. Add the package to your project via NuGet package manager

  2. Use the libary

using Kexla;
  1. Define your own class based on the property(s) that you need
[WMIClass(name: "Win32_NetworkAdapter")]
public class NetworkAdapter
{
    [WMIProps(name: "MACAddress")]
    public string MACAddress { get; set; }

    public string Caption { get; set; }

    public override string ToString()
    {
        return "MACAddress " + MACAddress
            + " Caption" + Caption;
    }

}

4.Query The Data

WMISearcher searcher = new WMISearcher(WMIClassTypes.CimV2);
var networkAdapters = searcher.Query<NetworkAdapter>();