This is a parameterized script that will perform bulk uploads of files from your local file system to SharePoint remotely.  This script uses CSOM and will maintain your existing file and folder structure, as it exists on your local file system.

Usage is relatively simple: .\BulkUploadSharePointCSOM.ps1 -UserName "user@contoso.com" -Password "SomePassword" -SiteURL "https://MyO365Site.sharepoint.com" -DocLibName "Documents" -Folder "D:\MyFolder\SomeSubfolder"

The purpose of this script is to provide an automated method to upload files from multiple accessible sources to your on-premesis SharePoint environments. Doing so against SharePoint Online (O365) is not recommended due to the chatty nature of the communication.  As the client side object model can be used in both on-premesis SharePoint and SharePoint Online, this can effectively be used in either scenario

This script cannot be used as a way to circumvent any throttling that is applied to the client-side object model.  The purpose of this script is to allow an automated alternative to the manual methods described in this article:
https://technet.microsoft.com/en-us/library/hh852518.aspx?f=255&MSPPError=-2147217396

For more information regarding throttling in SharePoint Online, see the following article:
https://msdn.microsoft.com/en-us/library/dn878981.aspx

Blog to follow in the near future