dcone80 / wsman
WSMan for PHP
v0.68-beta
2017-12-04 21:21 UTC
Requires
- guzzlehttp/guzzle: ^6.3
- ramsey/uuid: ^3.7
This package is auto-updated.
Last update: 2024-10-06 04:28:32 UTC
README
-- Coming soon!
Installation
You don't (just yet). The package is not quite ready ^_^
Usage
Create a client
use dcone80\Wsman\Wsman; $client = new Wsman([ 'location' => "http://TARGET-HOST:5985", 'login' => 'username', 'password' => 'password', ]);
Simple Queries
Identity target
$response = $client->identify();
Get WinRM Config
$config = $client->get('winrm/config');
WMI Queries
Get Volume C:
$response = $client->get('wmicimv2/Win32_logicaldisk', ['DeviceId' => 'C:']);
List Windows Services:
$response = $client->enumerate('wmicimv2/Win32_Service');
Using WQL:
$params = [
'dialect' => 'WQL',
'query' => 'select * from Win32_Service WHERE DelayedAutoStart = "true"'
];
$results = $client->enumerate('wmicimv2/*', $params);
Windows Registy Query
$params = [ 'hDefKey' => '2147483650', 'sSubKeyName' => 'SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'sValueName' => 'ProductName' ]; $response = $client->invoke('GetStringValue', 'wmi/root/default/StdRegProv', $params);
TODO
- Support for BASIC Authentication
- Support for Negotiate Authentication
- Implement Get Method
- Implement Identify Method
- Implement Enumerate Method
- Implement Invoke Method
- Implement Put Method
- Implement Delete Method
- Handle Errors and failed requests
- Use Guzzlehttp client instead of plain CURL
- Test againsts non-Windows based devices
- Handle/Remove hard-coded language tags in SOAP headers