Purpose:
This article provides a step by step guide on how to configure automated, graceful reboots of Amazon WorkSpaces using AWS Systems Manager (SSM). A graceful reboot behaves the same as clicking Restart inside Windows and does not force shutdown of applications.
—————
Prerequisites
Before beginning, confirm the following:
• WorkSpaces must be Windows-based
• SSM Agent must be installed (included with standard WorkSpaces images)
• WorkSpaces must be visible under Systems Manager → Node Management → Managed nodes
• WorkSpaces require access to SSM service endpoints
—————
STEP 1 - Tag Each WorkSpace
Tagging groups WorkSpaces so automated reboot targets only those tagged.
1. Go to AWS Console → WorkSpaces → WorkSpaces
2. Select the desired WorkSpace
3. Add a tag:
Key: Maintenance
Value: WeeklyReboot
Repeat for each WorkSpace you want rebooted automatically.
—————
STEP 2 - Verify Managed Node Status
1. Go to AWS Console → Systems Manager
2. Navigate to Node Management → Managed nodes
3. Confirm each WorkSpace shows as a managed node
—————
STEP 3 - Create a Maintenance Window
1. Go to Systems Manager → Maintenance Windows
2. Select Create maintenance window
Enter: - Name: weekly-workspaces-reboot - Schedule (example: Sundays at 2 AM CST):
cron(0 2 ? * SUN *)
• Time zone: America/Chicago
• Duration: 2
• Stop initiating tasks: 1
• Save
Enable the maintenance window.
—————
STEP 4 - Register WorkSpace Targets
1. Inside the maintenance window, select Actions → Register targets
2. Target type: Managed nodes
3. Choose Specify tags
4. Enter tag values used earlier:
Key: Maintenance
Value: WeeklyReboot
5. Name the target: workspace-reboot-target
6. Save
—————
STEP 5 - Add Reboot Task (Graceful)
1. Inside the maintenance window, select Actions → Register task
2. Choose task type: Run Command
3. For the document, choose: AWS-RunPowerShellScript
4. Under Command Parameters, enter:
Restart-Computer
The command intentionally excludes -Force. This allows a graceful reboot so Windows can close apps properly.
5. Under Targets, select the target created earlier
6. Rate controls:
– Concurrency: 10 percent
– Error threshold: 10 percent
7. Select or create the required IAM role when prompted
8. Save
—————
STEP 6 - Testing the Reboot
1. In the Maintenance Window page, choose Actions → Run now
2. Verify the WorkSpace reboots normally
3. Confirm the reboot action appears under Systems Manager → Run Command → Command history
—————
Troubleshooting
Symptom | Resolution |
WorkSpace does not show in Managed nodes | Verify network access to SSM, SSM Messages, EC2 Messages |
Reboot does not trigger | Confirm tags match exactly (case sensitive) |
User sessions are disrupted | Adjust schedule cron time to off hours |
—————
Quick Summary
1. Tag WorkSpaces for automation
2. Create Maintenance Window
3. Register targets using tags
4. Register Run Command task using Restart-Computer
This provides a safe and automated reboot strategy without forcing shutdowns.