Ubuntu : Connecting SharePoint Online using PowerShell

Hi All,
Greetings for the day 🙂 LIFE IS BEAUTIFUL 🙂
Today something new learning – completely new for me as well so sharing 🙂
Background : In our organization we have some users who are using M365 on Linux operating system. One of the user want some script to upload documents in SharePoint online document library. Since I never use Linux OS for connecting M365 using some script or PowerShell, need to do bit research starting with having Linux OS itself for testing
One of my friend courtesy he shared Ubuntu boo-table with me and I have Ubuntu and I am ready to test
Take away from this article :
- Installing PowerShell on Ubuntu
- Installing SharePoint online module
- Installing SharePoint PnP online module
- Connecting to SharePoint admin site
- Executing other PnP online commands
So lets begin fun 🙂
Note : I am first time using Ubuntu so my knowledge regarding this is limited so in case if you have any suggestion / feedback / thought on article kindly please put in comment box
- I have Ubuntu boo-table version “20.04.2.0LTS”
- Navigate to “ubuntu software” for installing PowerShell as
- Search for the “powershell” , select first option “powershell” as
- Install the “powershell” as shown in below fig
- Once powershell installed successfully, open it
- Search for the PowerShell app from apps and open
- Once we have PowerShell, we are ready to install the module for SharePoint Online – Microsoft.Online.SharePoint.PowerShell
- While installing we will get an warning for – “untrusted repository” as shown in below fig
- Please press “A” and continue
- But still we need to use “Set-PSPRepository” cmdlet to set the “InstallationPolicy” for PowerShell repository for current user
- To get the name of PowerShell repository we will use “Get-PSPRepository”
- Default PowerShell repository name is “PSGallery” as shown in below fig
- Once we have PowerShell repository name we can set “InstallationPolicy” value to “Trusted” so that we are not prompted before installing modules from that source

- Once we have set “InstallationPolicy” to “Trusted” for PowerShell repository we ready to install SharePoint Online module => “Microsoft.online.SharePoint.PowerShell” and SharePoint PnP online modules => “SharePointPnPPowerShellOnline” as
- On successful installation of the respective module we are ready to execute sharepoint online commands 🙂
- We are connecting using “Connect-PnPOnline” as shown in below fig

- After successfully connection, we are ready to execute other commands
- As in below fig we are executing “Get-PnPUser” cmdlet 🙂
Thanks for reading 🙂 If its worth at least reading once, kindly please like and share 🙂 SHARE ING IS CARING 🙂
Share In Teams:Enjoy the beautiful life 🙂 Have a FUN 🙂 HAVE A SAFE LIFE 🙂 TAKE CARE 🙂
You must log in to post a comment.