SharePoint Online - Setting up PowerShell
Install the prerequisites and the SharePoint Online Management Shell, then connect to your tenant.
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
- Install Windows Management Framework 3.0. This needs a restart.
- Install the SharePoint Online Management Shell.
- 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.