AWSSupport-ManageWindowsService - Amazon Systems Manager Automation runbook reference
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).



The AWSSupport-ManageWindowsService runbook enables you to stop, start, restart, pause, or disable any Windows service on the target instance.

Run this Automation (console)

Document type







  • AutomationAssumeRole

    Type: String

    Description: (Optional) The Amazon Resource Name (ARN) of the Amazon Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook.

  • InstanceId

    Type: String

    Description: (Required) The ID of the managed instance to manage the services of.

  • ServiceAction

    Type: String

    Valid values: Check | Restart | Force-Restart | Start | Stop | Force-Stop | Pause

    Default: Check

    Description: (Required) An action to apply to the Windows service. Note that Force-Restart and Force-Stop can be used to restart and to stop a service that has dependent services.

  • StartupType

    Type: String

    Valid values: Check | Auto | Demand | Disabled | DelayedAutoStart

    Default: Check

    Description: (Required) A startup type to apply to the Windows service.

  • WindowsServiceName

    Type: String

    Description: (Required) A valid Windows service name.

Required IAM permissions

The AutomationAssumeRole parameter requires the following actions to successfully use the runbook.

It is recommended that the EC2 instance receiving the command has an IAM role with the AmazonSSMManagedInstanceCore Amazon managed policy attached. The user must have at least ssm:StartAutomationExecution and ssm:SendCommand to run the automation and send the command to the instance, plus ssm:GetAutomationExecution to be able to read the automation output.

Document Steps

aws:runCommand - Run the PowerShell script to apply the desired configuration to the Windows service on the target instance.