SSM Agent在EC2執行個體上手動安裝和解除安裝 Windows Server - AWS Systems Manager

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

SSM Agent在EC2執行個體上手動安裝和解除安裝 Windows Server

AWS Systems Manager 根據預設,會在 Amazon Windows Server 提供的下列 Amazon Machine Images (AMIs) 上預先安裝代理程式 ():SSM Agent

  • Windows Server 2008-2012 R2 AMIs 發佈於 2016 月 11 月或之後

  • Windows Server不包括納米版本)

SSM Agent在EC2執行個體上安裝 Windows Server

如有必要,您可以使用下列程序,SSM Agent在 Amazon 彈性運算雲端 (AmazonEC2) 執行個體上手動下載並安裝最新版本的。Windows Server此程序中提供的命令也可以透過使用者資料以指令碼的形式傳遞至 Amazon EC2 執行個體。

SSM Agent需要 Windows PowerShell 3.0 或更新版本,才能在執行個體 (例如,舊版SSM文件) 上Windows Server執行某些 AWS Systems Manager 文件 (AWS-ApplyPatchBaseline文件)。確認您的 Windows Server 執行個體執行 Windows Management Framework 3.0 或更新版本。這個框架包括視窗 PowerShell。如需詳細資訊,請參閱 Windows Management Framework 3.0

注意

此程序適用於在的EC2執行個體SSM Agent上安裝或重新安裝Windows Server。如果您需要在內部部署伺服器或虛擬機器 (VM) 上安裝代理程式,以便與 Systems Manager 搭配使用,請參閱如何SSM Agent在混合式 Windows 節點上安裝

若要手動安裝最新版本的 SSM Agent on EC2 執行個體 Windows Server
  1. 使用遠端桌面或 Windows Connect 至您的執行個體 PowerShell。如需詳細資訊,請參閱 Amazon EC2 使用者指南中的 Connect 到執行個體

  2. 下載最新版本的 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 值,請參閱中 Systems Manager 服務端點中的「區域」欄Amazon Web Services 一般參考

    PowerShell

    依序執行下列三個 PowerShell 命令。這些命令允許您直接下載 SSM Agent,而不用調整 Internet Explorer (IE) 增強安全性設定,並可接著安裝代理程式及移除安裝檔案。

    64-bit
    [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
    32-bit
    [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"
    rm -Force $env:USERPROFILE\Desktop\SSMAgent_latest.exe
    直接下載

    使用下列連結,下載 SSM Agent 的最新版本至執行個體。如果需要,請使URL用 AWS 區域特定的URL.

    https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/最新/視窗_AM64/一個Setup.exe mazonSSMAgent

    執行下載的 AmazonSSMAgentSetup.exe 檔案來安裝 SSM Agent。

  3. 在中傳送下列指令SSM Agent來啟動或重新啟動 PowerShell:

    Restart-Service AmazonSSMAgent

SSM Agent從EC2執行個體解除安裝 Windows Server

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