hero

WMI Scripting

WMI Scripting and Querying made easy.

Documentation

Active Record Querying

Easily Testable

Simple API

Quick Start

Install

REQUIREMENTS

>= PHP 7.1

Windows and the com_dotnet extension enabled (available in every Windows PHP release).

composer require phpwintools/wmi-scripting
1

Connections with instantiation

$scripting = new Scripting;

// These connections can be called by name.
$scripting->addConnection('server1', Connection::simple('server1', 'user', 'password'));
$scripting->addConnection('server2', Connection::simple('server2', 'user', 'password'));

$scripting->query('server2')->loggedOnUser()->get();

// This will set 'server1' as the default connection.
$scripting->setDefaultConnection('server1');

// If no connection is referenced then the default connection will be used.
$scripting->query()->loggedOnUser()->get();
1
2
3
4
5
6
7
8
9
10
11
12
13

Connections with static calls

LoggedOnUser::query(Connection::simple('server1', 'user', 'password'))->get();
1