D2Services
Show system services
- Type
- javascript
- Pack
- D2
Source
function servicesLinux() {
packOutput('service --status-all');
}
function servicesDarwin() {
packOutput('launchctl list');
}
function servicesWindows() {
pack(wmi_query('select Name,Description,PathName,StartMode,ProcessId,State,StartName from Win32_Service'), 'table');
}
try {
if (env.OS === 'windows') {
servicesWindows();
} else if (env.OS === 'linux') {
servicesLinux();
} else {
servicesDarwin();
}
} catch (ex) {
pack('Error: ' + ex);
}
README
Shows the systems services.
Script Data
| Name | Description |
|---|---|
| Script Type | javascript |
| Tags | agent, endpoint |
Inputs
There are no inputs for this script.
Outputs
There are no outputs for this script.