

• 2026 年 4 月 30 日之後， AWS Systems Manager CloudWatch Dashboard 將不再可用。客戶可以繼續使用 Amazon CloudWatch 主控台來檢視、建立和管理其 Amazon CloudWatch 儀表板，就像現在一樣。如需詳細資訊，請參閱 [Amazon CloudWatch Dashboard 文件](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 在 Windows Server EC2 執行個體上手動安裝和解除安裝 SSM Agent
<a name="manually-install-ssm-agent-windows"></a>

AWS Systems Manager 在 Amazon Windows Server提供的下列 (SSM Agent) 上，預設會預先安裝代理程式 Amazon Machine Images(AMIs)：
+ 2016 年 11 月或之後發布的 Windows Server 2012 R2 AMIs
+ Windows Server 2016、2019、2022 (Nano 版本除外) 和 2025

**重要**  
強烈建議您避免使用已達生命週期結束 (EOL) 的作業系統版本。包括 在內的作業系統廠商 AWS 通常不會為已達到 EOL 的版本提供安全修補程式或其他更新。繼續使用 EOL 系統可大幅提高無法套用升級的風險，包括安全性修正和其他操作問題。 AWS 不會在已達到 EOL 的作業系統版本上測試 Systems Manager 功能。

## 在 Windows Server EC2 執行個體上安裝 SSM Agent
<a name="windows-install-agent"></a>

如有需要，您可以使用以下程序，在 Windows Server 的 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體上手動下載並安裝最新版本的 SSM Agent。此程序中所提供的命令也可以透過使用者資料，以指令碼的形式傳遞至 Amazon EC2 執行個體。

SSM Agent 需要 Windows PowerShell 3.0 或更新版本，才能在 Windows Server 執行個體上執行特定 AWS Systems Manager 文件 (SSM 文件) (例如，舊版 `AWS-ApplyPatchBaseline` 文件)。確認您的 Windows Server 執行個體執行 Windows Management Framework 3.0 或更新版本。這個架構包含 Windows PowerShell。如需詳細資訊，請參閱 [Windows Management Framework 3.0](https://www.microsoft.com/en-us/download/details.aspx?id=34595&751be11f-ede8-5a0c-058c-2ee190a24fa6=True)。

**其他機器類型的安裝**  
本主題中的此程序特別適用於在 Windows Server EC2 執行個體上安裝或重新安裝 SSM Agent。對於內部部署伺服器、虛擬機器或其他非 EC2 環境，請使用[在混合 Windows Server 節點上安裝 SSM Agent](hybrid-multicloud-ssm-agent-install-windows.md) 中所述的 `ssm-setup-cli` 工具。  
在非 EC2 系統上使用 EC2 安裝程序可能會導致安全漏洞。`ssm-setup-cli` 工具為非 EC2 機器提供額外的安全保護。

**在 Windows Server 的 EC2 執行個體上手動安裝 SSM Agent 的最新版本**

1. 使用遠端桌面或 Windows PowerShell 連線至您的執行個體。如需詳細資訊，請參閱《Amazon EC2 使用者指南》**中的 [Connect to your instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2_GetStarted.html#ec2-connect-to-instance-windows)。

1. 下載最新版本的 SSM Agent 到您的執行個體。您可以使用 PowerShell 命令或直接下載連結進行下載。
**注意**  
此步驟中的 URLs 可讓您SSM Agent從*任何* AWS 區域下載。如果您想要從特定區域下載代理程式，請改為使用區域特定的 URL：  
`https://amazon-ssm-region.s3.region.amazonaws.com/latest/windows_amd64/AmazonSSMAgentSetup.exe`  
*region* 代表 AWS 區域 支援的 識別符 AWS Systems Manager，例如`us-east-2`美國東部 （俄亥俄） 區域。如需支援的 *region* 值的清單，請參閱《Amazon Web Services 一般參考》**中 [Systems Manager 服務端點](https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region)一節的**區域**資料欄。  
**PowerShell**  
依序執行下列三個 PowerShell 命令。這些命令允許您直接下載 SSM Agent，而不用調整 Internet Explorer (IE) 增強安全性設定，並可接著安裝代理程式及移除安裝檔案。  

   ```
   [System.Net.ServicePointManager]::SecurityProtocol = 'TLS12'
   $progressPreference = 'silentlyContinue'
   Invoke-WebRequest `
       https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe `
       -OutFile $env:USERPROFILE\Desktop\SSMAgent_latest.exe
   ```

   ```
   [System.Net.ServicePointManager]::SecurityProtocol = 'TLS12'
   $progressPreference = 'silentlyContinue'
   Invoke-WebRequest `
       https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_386/AmazonSSMAgentSetup.exe `
       -OutFile $env:USERPROFILE\Desktop\SSMAgent_latest.exe
   ```

   ```
   Start-Process `
       -FilePath $env:USERPROFILE\Desktop\SSMAgent_latest.exe `
       -ArgumentList "/S" `
       -Wait
   ```

   ```
   rm -Force $env:USERPROFILE\Desktop\SSMAgent_latest.exe
   ```  
**直接下載**  
使用下列連結，下載 SSM Agent 的最新版本至執行個體。如果需要，請使用 AWS 區域特定 URL 更新此 URL。  
[https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows\$1amd64/AmazonSSMAgentSetup.exe](https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe)  
執行下載的 `AmazonSSMAgentSetup.exe` 檔案來安裝 SSM Agent。

1. 在 PowerShell 中傳送以下命令來啟動或重新啟動 SSM Agent：

   ```
   Restart-Service AmazonSSMAgent
   ```

**注意**  
若要從 Windows Server 執行個體解除安裝 SSM Agent，請開啟**控制面板**、**程式**。選擇 **Uninstall a program** (解除安裝程式) 選項。開啟 **Amazon SSM Agent** 的內容 (按一下滑鼠右鍵) 選單，然後選擇**解除安裝**。