Upload files to FTP server

As Technet Gallery is retiring so moving the code to Git Hub. (click below github download link for this script)

Upload files to FTP server

Hi Readers,

 

We got a requirement to upload files to ftp from an application server that will drop files to particular folder.

So we have created a nice shell script to do this job & scheduled it via windows task manager.

Script does the following:

  1. It will check if the source folders have files to process , if not than it will exit
  2. Upload those files to FTP
  3. Files that have been uploaded are moved to processed folder (folder name is time stamped)
  4. Error checking–> if there is error while processing it wll email.
  5. Detailed logging has been added.

Download & extract the script, below are the variables that I have used , you can change them accordingly

###########################Variables######################################
$smtpServer = “smtp.lab.com” # Change

$fromadd = “DoNotReplyftp@lab.com” # Change

$email1 = “Vikas.Sukhija@lab.com”  # Change

$ftp = “ftp://127.0.0.1/” # Change

$user = “vikas”  # Change$pass = “password” # Change

$uploadfpath = “C:\Uploadftp\ftpfiles” # Define the Folder from where files will be uploaded
###########################################################################

here is what it will look like, after changing the variables, you just have to run the batch file

Capture

 

Tech Wizard

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Cheat Book