

# `AWSSupport-ManageWindowsService`
<a name="automation-awssupport-managewindowsservice"></a>

 **Description** 

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

[Run this Automation (console)](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-ManageWindowsService)

**Document type**

Automation

**Owner**

Amazon

**Platforms**

Windows

**Parameters**
+ AutomationAssumeRole

  Type: String

  Description: (Optional) The Amazon Resource Name (ARN) of the AWS 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 \$1 Restart \$1 Force-Restart \$1 Start \$1 Stop \$1 Force-Stop \$1 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 \$1 Auto \$1 Demand \$1 Disabled \$1 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 use the runbook successfully.

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.

 **Outputs** 

manageWindowsService.Output