Remotely get Windows service status from AWS EC2 instance

Viewed 21

I am not sure if this is possible but I am having some trouble finding relevant info online. I was hoping to write a Powershell script that would return me the status of particular Windows services running on Windows EC2 instances on AWS.

Is there a way to get the status of Windows Services on EC2 Windows machines through the command line? From what I have found the only way to get the status of a Windows service running on a Windows EC2 instance is to manually login through the AWS console and login via RDP.

I was hoping to be able to just run a PowerShell script to return me this information via the command line for a set of Windows instances we have in EC2 but I am not sure if that is possible. I think if these had been Linux boxes it would have been easier using ssh or something to that effect.

Thanks

1 Answers

I was hoping to be able to just run a PowerShell script to return me this information via the command line for a set of Windows instances we have in EC2 but I am not sure if that is possible

You can achieve this by using SSM RunCommand with the AWS-RunPowerShellScript document against the EC2 instances. This way, you won't need to login inside the instances.

Related