How to Setup the CloudWatch Powershell Scripts to Monitor a Windows Instance

How to Setup the CloudWatch Powershell Scripts to Monitor a Windows Instance

Amazon CloudWatch provides monitoring for the AWS cloud resources hence the applications customers run on AWS. Developers, devops and system administrators can use it to collect and track utilization metrics, gain insights, and get immediate responses on their online services performance and availability.

The Amazon CloudWatch Monitoring Scripts for Linux and Windows demonstrate how to produce and consume the Amazon CloudWatch custom metrics. The scripts for Windows include sample PowerShell scripts, which comprise a fully functional example. That example reports memory, page file, and disk space utilization metrics for an Amazon EC2 Windows instance.

The present guide shows how to setup CloudWatch Powershell scripts in a Windows instance.

1. Launch a Windows instance and connect to the instance.

2. Download and install AWS SDK for .Net to the user’s Windows instance.


[Newvem analyzes your baseline disaster recovery (DR) status, reflecting how well AWS DR best practices have been implemented, and recommends AWS features and best practices to reach optimal availability, increase outage protection, and quick recovery. Learn More]


3. It will ask to save /run the installable. The output window shown below will vary based on the user’s browser. Either select “Run” or select the “Save & Run” option.

4. Once the SDK for .Net is installed, select the default configuration options when asked and click on “Next” to complete the process.

5. Click on “Finish” to complete the installation process.

6. Download the.zip file containing the Amazon CloudWatch Monitoring Scripts for Microsoft Windows Server into the EC2 instance. Next, unzip it in a location of the user’s preference.

7. Save the file on the user’s Windows instance local directory.

8. Unzip the downloaded zip file in the Windows instance machine. It consists of various files. The files with the .ps1 extension are the Powershell scripts. The awscreds.conf file is used to configure the user’s AWS account credentials.

9. Open the awscreds.conf file and set your AWS access key and secret access key.

10. To test the setup, first open the command window and browse trough the folder where the zip file has been unzipped in step#8. Run the command mon-put-metrics-mem.ps1 –mem_util –mem_avail command.

11. To run the Powershell in the Windows instance, go to Start Menu and select the Amazon Web Services > “Windows Powershell for AWS” from the installed programs.

12. It will open the Powershell command window.

13. Run the command .\mon-put-metrics-mem.ps1 -aws_credential_file C:\AWS\AmazonCloudWatchMonitoringWindows\awscreds.conf –verbose to test the installation.

14. If it gives an output similar to the above displayed output, the installation for the Powershell script has been successfully completed.

Learn How to Use the CloudWatch Powershell Scripts to Monitor a Windows Instance


[Newvem analytics tracks you AWS cloud utilization:

  • Hourly Utilization Pattern Analysis 
  • Reserved Instances Decision Tool 
  • Resource Resizing Opportunities

Create Your Free Account or Learn More]


Keywords: Amazon web services, Amazon AWS console, Amazon AWS instances, EC2 Service, Amazon cloud computing, Amazon EC2 capacity, Cloud Monitoring, Utilization, CloudWatch, CloudWatch Alarm, EC2 Instance, AWS SDK, CloudWatch Powershell, CLI tools, Amazon Cloud API

You must be to post a comment.

* As a bonus, you'll receive our weekly newsletter!

Hitchhiker's Guide to The Cloud

Newvem's eBook for Cloud Operations