Windows Service Information

Contents

Windows Service Information

Description

With two dedicated remote actions, retrieve and set the status and startup type of Windows services. Useful for ensuring that required services are functioning correctly.

Platforms

  • Windows 7, 8.1 and 10.

License modules

  • Nexthink Act.

Compatibility

  • Nexthink V6.14 and later.

Script Get Service Information

  • Version 1.0.0.1 - Fixed an error when the service is not found and some code improvements
  • Version 1.0.0.0 - Initial release

Script Description

The script returns the current status and startup type of each service specified in the parameters. Useful for verifying that the status of critical services (e.g. Antivirus, SCCM agent, core business applications, etc.) is in accordance with corporate policies.

Execution context and suggested scheduling

Run the script manually as local system.

Parameters

ID Label Description
1 ServiceName Comma-separated list of services whose status and startup type are requested

Outputs

ID Label Type Description
1 ServiceStatus StringList Name, current status, and startup type of the requested service(s)

Further Information

Service names are case-insensitive.

Script Set Service Information

  • Version 1.0.0.0 - Initial release

Script Description

ADVANCED SCRIPT
The script enables the modification of the status and startup type of one or multiple services, which are provided as input.
Useful for enforcing the expected status of critical services (e.g. Antivirus, SCCM agent, core business applications, etc.) in accordance with corporate policies.

Execution context and suggested scheduling

Run the script manually as local system.

Parameters

ID Label Description
1 ServiceName The service (or comma-separated list of services) whose status or startup type will be modified. Service names are case-insensitive
2 StatusChange The action (or comma-separated list of actions) to apply to the status of the specified service (or comma-separated list of services)
3 SetStartTypeTo The startup type (or comma-separated list of startup types) to apply to the specified service (or comma-separated list of services)

Outputs

ID Label Type Description
1 UpdatedServiceStatus StringList Name, status, and startup type of the requested service (or list of services) before and after the change

Further Information

  • Type "" if you do not wish to change either the status or the startup type of a particular service.
  • Both action names and startup type names are case-insensitive.
  • Valid actions: Start, Stop, Restart, Pause, Resume.
  • Valid startup types: Auto, Auto (Delayed Start), Manual, Disabled.
  • Find the names of the available services in a device by opening the Services tab of the Task Manager (look under the Name column).
  • Because of the unpredictable behavior of Windows services, note that your changes may be overwritten.
ADVANCED
This script requires customization by an expert and needs to be thoroughly tested. The potential impact on your environment might also require sign off from the Security Team.
Please, ensure that you don't stop or disable essential Windows services.

Restrictions

  • When setting the startup type to Disabled, only Stop and "" (empty action) are valid actions for setting the state.
  • The action Auto (Delayed Start) is only valid if the registry key DelayedAutoStart exists under:
    HKLM:\SYSTEM\CurrentControlSet\services*
  • The script Set service Information cannot modify the startup type of Windows services that are triggered by events.