本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
AWS Systems Manager 根據預設,Amazon 為 Windows Server提供的下列 (SSM Agent) 預先安裝代理程式 Amazon Machine Images(AMIs):
-
Windows Server 2008-2012 R2 AMIs 發佈於 2016 月 11 月或之後
-
Windows Server 2016、2019 和 2022 (Nano 版本除外)
在 Windows Server EC2 執行個體上安裝 SSM Agent
如有需要,您可以使用以下程序,在 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
注意
此程序適用於在 Windows Server 的 EC2 執行個體上安裝或重新安裝 SSM Agent。如果您需要在內部部署伺服器或虛擬機器 (VM) 安裝代理程式,以便與 Systems Manager 搭配使用,請參閱如何在混合 Windows 節點上安裝 SSM Agent。
在 Windows Server 的 EC2 執行個體上手動安裝 SSM Agent 的最新版本
-
使用遠端桌面或 Windows PowerShell 連線至您的執行個體。如需詳細資訊,請參閱《Amazon EC2 使用者指南》中的 Connect to your instance。
-
下載最新版本的 SSM Agent 到您的執行個體。您可以使用 PowerShell 命令或直接下載連結進行下載。
注意
此步驟中的 URLs 可讓您SSM Agent從任何 AWS 區域下載 。如果您想要從特定區域下載代理程式,請改為使用區域特定的 URL:
https://amazon-ssm-
region
.s3.region
.amazonaws.com/latest/windows_amd64/AmazonSSMAgentSetup.exeregion
代表 支援的 AWS 區域 識別符 AWS Systems Manager,例如us-east-2
美國東部 (俄亥俄) 區域。如需支援的region
值的清單,請參閱《Amazon Web Services 一般參考》中 Systems Manager 服務端點一節的區域資料欄。- 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
Start-Process ` -FilePath $env:USERPROFILE\Desktop\SSMAgent_latest.exe ` -ArgumentList "/S" ` -Wait
rm -Force $env:USERPROFILE\Desktop\SSMAgent_latest.exe
- 直接下載
-
使用下列連結,下載 SSM Agent 的最新版本至執行個體。如果您想要,請使用特定 URL AWS 區域更新此 URL。
https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe
執行下載的
AmazonSSMAgentSetup.exe
檔案來安裝 SSM Agent。
-
在 PowerShell 中傳送以下命令來啟動或重新啟動 SSM Agent:
Restart-Service AmazonSSMAgent
注意
若要從 Windows Server 執行個體解除安裝 SSM Agent,請開啟控制面板、程式。選擇 Uninstall a program (解除安裝程式) 選項。開啟 Amazon SSM Agent 的內容 (按一下滑鼠右鍵) 選單,然後選擇解除安裝。