Skip to content
Amal Hashim
All posts
Article

SharePoint Online - Setting up PowerShell

Install the prerequisites and the SharePoint Online Management Shell, then connect to your tenant.

1 min read#Office#PowerShell#SharePoint

A SharePoint global administrator can use the SharePoint Online Management Shell to manage sites and content from the command line. Setting it up takes two installs.

Steps

  1. Install Windows Management Framework 3.0. This needs a restart.
  2. Install the SharePoint Online Management Shell.
  3. Start "SharePoint Online Management Shell" and connect:
powershell
Connect-SPOService -Url https://tenant-admin.sharepoint.com -Credential admin@tenant.com

Replace tenant with your own tenant name. You will be asked for the password.

Example

Once connected you can run SPO cmdlets remotely. This retrieves all site collections:

powershell
Get-SPOSite

The full list of supported cmdlets is in the SharePoint Online cmdlet reference.