Using Powershell to describe all EC2 instances including administrator password
November 12, 2015
When using EC2, I find it a laborious process to log in to the AWS console and retrieve all of the
information required to remote desktop to an instance and then even more clicks to retrieve the administrator
password. If you have created N instances using something like CloudFormation, then this time increases by
N times depending on the number of instances you want to access.
The script at the end of this article retrieves all of the common information you need about your EC2
instances with just one command as well as decrypting all of the passwords saving a lot of time and effort.
All that is required to run it is the AWS Tools for Powershell
and the PEM file the instances were assigned to so that the password can be decrypted.
Here is an example of the output you will get:
And the script to generate it:
To add in the public IP address of the instance, just duplicate an Add-Member entry and change the
Name parameter and the Value parameter to PublicIpAddress.