Please check the Activation Code, as the Error says the Code. is invalid. $code = "activation-code", How to create activation Code.
Here is the link to find the Activation https://eu-west-1.console.aws.amazon.com/systems-manager/activations/ Check for Activation ID and **Activation ID ** use in the CLI while running the command.
$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.$region.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"
We just had this error occur as well, but on a LInux external instance. Generating a new activation code and id worked fine.
I'm curious that the activation code that failed started with a
/ and also contained a
+, the successful activation code was only
SSM Agent update problemsAccepted Answerasked 6 months ago
What protocol and port # does SSM agent run on?asked 5 years ago
Amazon SSM agent service not startingasked 5 years ago
SSM Agent Won't Startasked 2 years ago
Error when trying to register a windows on premise SSM agent (and missing error details)asked 8 months ago
SSM agent won't get new tokens after network failure resolvedasked a year ago
ERROR [ssm-agent-worker] [MessagingDeliveryService] error when calling AWS APIs. error details - GetMessages Error: EC2RoleRequestError: no EC2 instance role foundasked 10 months ago
Crowdstrike detection of malicious activity of Amazon SSM Agent for WindowsAccepted Answerasked 6 months ago
SSM Agent update failureasked 10 months ago
SSM agent service failed to start on windows-server 2019 (datacenter)asked 8 months ago