In your travels, you may come across PowerShell examples that leverage client-side object model (CSOM) to complete tasks in SharePoint Online. CSOM has the benefit of providing granular access to the SharePoint API. It has the shortcoming of requiring the programmer to understand not only the complexity of SharePoint's server-side API but also the nuances of asynchronous communication models used primarily for writing web services.
Nevertheless, there will be many times when CSOM is your only option for automating tasks in SharePoint Online. It's important to understand the basic pattern to connect to a SharePoint site and perform actions using this powerful framework.
You can leverage CSOM by copying the required ...