AWS Systems Manager
User Guide

Step 5: Install SSM Agent for a Hybrid Environment (Windows)

This topic describes how to install SSM Agent on Windows Server machines in a hybrid environment. If you plan to use Linux machines in a hybrid environment, see the next step, Step 6: Install SSM Agent for a Hybrid Environment (Linux).

Important

This procedure is for servers and virtual machines (VMs) in an on-premises or hybrid environment. To download and install SSM Agent on an Amazon EC2 Windows instance, see Installing and Configuring SSM Agent on Windows Instances.

Before you begin, locate the Activation Code and Activation ID that were sent to you after you completed the managed-instance activation earlier in Step 4: Create a Managed-Instance Activation for a Hybrid Environment. You specify the Code and ID in the following procedure.

To install SSM Agent on servers and VMs in your hybrid environment

  1. Log on to a server or VM in your hybrid environment.

  2. Open Windows PowerShell in elevated (administrative) mode.

  3. Copy and paste the following command block into AWS Tools for Windows PowerShell. Replace the placeholder values with the Activation Code and Activation ID generated when you create a managed-instance activation, and with the identifier of the AWS Region you want to download SSM Agent from.

    region represents the Region identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in the AWS Systems Manager Table of Regions and Endpoints topic in the AWS General Reference.

    $code = "activation-code" $id = "activation-id" $region = "region" $dir = $env:TEMP + "\ssm" New-Item -ItemType directory -Path $dir -Force cd $dir (New-Object System.Net.WebClient).DownloadFile("https://amazon-ssm-$region.s3.amazonaws.com/latest/windows_amd64/AmazonSSMAgentSetup.exe", $dir + "\AmazonSSMAgentSetup.exe") Start-Process .\AmazonSSMAgentSetup.exe -ArgumentList @("/q", "/log", "install.log", "CODE=$code", "ID=$id", "REGION=$region") -Wait Get-Content ($env:ProgramData + "\Amazon\SSM\InstanceData\registration") Get-Service -Name "AmazonSSMAgent"
  4. Press Enter.

The command does the following:

  • Downloads and installs SSM Agent onto the server or VM.

  • Registers the server or VM with the SSM service.

  • Returns a response to the request similar to the following:

        Directory: C:\Users\ADMINI~1\AppData\Local\Temp\2
    
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----       07/07/2018   8:07 PM                ssm
    {"ManagedInstanceID":"mi-008d36be46EXAMPLE","Region":"us-east-2"}
    
    Status      : Running
    Name        : AmazonSSMAgent
    DisplayName : Amazon SSM Agent

The server or VM is now a managed instance. These instances are now identified with the prefix "mi-". You can view managed instances on the Managed Instances page in the Systems Manager console, by using the AWS CLI command describe-instance-information, or by using the API command DescribeInstanceInformation.

Continue to Step 6: Install SSM Agent for a Hybrid Environment (Linux).