Discovering Windows Version on EC2 Instances
By Brian
Windows Server 2003 end of life is less than six months away. As I start to think about upgrading, I was looking for an easy way to identify what version of Windows is running on each EC2 instance. I would like to do this without having to log into each instance.
One solution is to use the System log. If the instance has the EC2 Config service running on it it will report the OS version (along with a few key driver versions to the console). You can access the System Log from the console by right clicking on an instance and choosing "View System Log". For example, the output below is from a Windows 2003 R2 instance I just launched. Notice the OSVersion on line three.
I created a script that will query the system log (also called the console) from every Windows instance in every region using PowerShell. It then applies a regular expression to parse the OS version number.
You can see the sample output below. The last instance is Windows 2003 indicated by the version number 5.2. You can find a list of version numbers on Microsoft's Web Site.
Now a few warnings. First, you must have EC2 Config installed in the instance to output information to the console. Second, depending on the version of EC2 config the output format is different. I have discovered two versions in my testing, but there may be others. Third, I have noticed that you cannot always distinguish the R2 version of an OS.
Blogger is messing with the script a bit. You can download a copy here. Just rename it from .txt to .ps1.
One solution is to use the System log. If the instance has the EC2 Config service running on it it will report the OS version (along with a few key driver versions to the console). You can access the System Log from the console by right clicking on an instance and choosing "View System Log". For example, the output below is from a Windows 2003 R2 instance I just launched. Notice the OSVersion on line three.
|
|
I created a script that will query the system log (also called the console) from every Windows instance in every region using PowerShell. It then applies a regular expression to parse the OS version number.
|
|
You can see the sample output below. The last instance is Windows 2003 indicated by the version number 5.2. You can find a list of version numbers on Microsoft's Web Site.
|
|
Blogger is messing with the script a bit. You can download a copy here. Just rename it from .txt to .ps1.