| home | true |
|---|---|
| heroImage | /hero-notext.png |
| actionText | Documentation |
| actionLink | /documentation/ |
:::warning
>= PHP 7.1
Windows and the com_dotnet extension enabled (available in every Windows PHP release).
:::
composer require phpwintools/wmi-scripting$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();LoggedOnUser::query(Connection::simple('server1', 'user', 'password'))->get();