SharePoint Online Management Shell is a command-line utility that helps admins and developers to interact with SharePoint sites without Graphical User Interfaces (GUI). This will allow the users to perform automation tasks such as

At first if no SharePoint module has been installed, when connecting to SPO service you might be getting error similar to below.

Installing SharePoint online Management Shell

Steps

There are 2 ways you can install the SharePoint Online Management shell.

In this article, we will look into both PowerShell way and Installer file.

Using Installer file

This is simple and pretty straightforward. Prashant has written detailed steps on how to do it. Please go through the link ‘how to install SharePoint online management shell’ from the references section.

Using PowerShell

Step 1. For the PowerShell you just have to run the below one line in the PS script pane

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

You might be getting below prompts.

After that you might be getting below message 'you are installing from untrusted repository'.

Installing SharePoint online Management Shell

Since the ‘PS Gallery’ is maintained by MSFT you can select ‘Yes’

Step 2. Validate the installation by running the below command. This will check the version of SharePoint online management shell.

Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version

Installing SharePoint online Management Shell

Updating to the Latest version

For updating to the latest version in the PowerShell command window just enter the below one line script.

Update-Module -Name Microsoft.Online.SharePoint.PowerShell

Issues

If you are getting an issue similar to below, try running the Powershell as admin and execute the command, or add the parameter ‘-scope currentuser’.

References