Skip to main content

1E 8.1 (on-premises)

OperatingSystem.GetServiceInfo

Module

OperatingSystem

Method

GetServiceInfo

Library

Core

Action

Retrieves a list of all services, or a single named service.

Parameters

Name (string, optional): The name of the single service (e.g. "winmgmt" for the WMI service) to return; omit this parameter to return data for all services. See Notes.

Return values

Name (string): The service's name.

Description (string): The descriptive name of the service.

Type (string): One of:

  • File system driver

  • Kernel driver

  • Own process

  • Per-user

  • Shared process

  • <empty string>

Note

'Per-user' is only reported from v5.2 onwards; it was an <empty string> for per-user services in older versions.

State (string): One of:

    • About to continue

    • Pausing

    • Paused

    • Running

    • Starting

    • Stopping

    • Stopped

ProcessId (int): The process identifier of the service, or 0 if the service is not running.

StartType (string): One of:

    • Automatic

    • Boot (kernel driver only)

    • Manual

    • Disabled

    • System (kernel driver only)

ErrorControl (string): One of:

    • SERVICE_ERROR_CRITICAL

    • SERVICE_ERROR_IGNORE

    • SERVICE_ERROR_NORMAL

    • SERVICE_ERROR_SEVERE

BinaryPath (string): The full path of the executable that is/will be started by the service controller.

StartAccountName (string): The name of the user account under which the service will be started.

DelayStart (boolean): True if the service is set to delayed auto-start (applies to Windows Vista and up).

TriggerStart (boolean): True if the service is set to start on a trigger (applies to Windows 7 and up).

Example

 OperatingSystem.GetServiceInfo();

Platforms

  • Windows

Notes

If you specify a service name to look up, it must be the complete name (i.e. the method does not do any partial matching).

If this service does not exist, or its details cannot be retrieved, the method returns no data.