PS: Backup To Amazon S3


So here is the situation: Our AS400 sends backups to our FTP daily. We needed a way to zip the files and upload them to Amazon S3. I found a way to do this PS, hopefully it will help someone out. To backup to Amazon S3 in Powershell, try the following:

NOTE: These steps require you download and install PSCX and AWS PS Tools

To Resolve:

1. In the SFTP VM: Copy and paste this into Powershell ISE (or Notepad and save as .ps1). Save to “C:\Scripts” (substitute your information below):

3. Next step is to find a way to upload these to the Amazon Cloud Storage. First we download PSCX and Amazon PS Tools and install them to SFTP.

4. Go to From there go to Groups – Name: Administrators – Policies: Administrator Access – Finish.

5. Now go to Users – name: (AdminAccountName) – Download credentials. Make sure to add that user to the Administrators group and assign the admin password via “Manage Password”.

6. Now that the account is setup, we can run the script in step 1.

You can load into your profile by running:
a. echo $profile #take note of the directory
b. notepad $profile #this opens it. If it doesn’t exists it creates it. Paste in:
c. Import-Module “C:\Program Files (x86)\AWS Tools\PowerShell\AWSPowerShell\AWSPowerShell.psd1”
d. Save the notepad document in the location from step A. If the directory doesn’t exist, create it exactly named as so.

This can be found in my gwFileSystem section.