Share via


SharePoint Online: How To Install Management Shell

SharePoint Management Shell is a Windows PowerShell Module that allows managing SharePoint Users, Sites & Content in an efficient manner.

In this article, we will see the steps to setup the development machines with “SharePoint Online Management Shell”.

First, let’s look for the System Requirements to avoid any frustrating compatibility issues that might arise later on:

System Requirement

Supported Operating System

  • Windows 7 Service Pack 1
  • Windows 8
  • Windows Server 2008 R2 SP1
  • Windows Server 2008 Service Pack 2
  • Windows Server 2012

PowerShell

  • PowerShell 3.0

Steps to Install SharePoint Online Management Shell

Step 1: Visit the URL: https://www.microsoft.com/en-in/download/details.aspx?id=35588

Step 2: Click Download button

https://howtodowithsharepoint.files.wordpress.com/2016/01/1.png?w=800

Step 3: Select “sharepointonlinemanagementshell_4727-1200_x64_en-us.msi” file and click Next

https://howtodowithsharepoint.files.wordpress.com/2016/01/2.png?w=800

Step 4: Run the **“sharepointonlinemanagementshell_4727-1200_x64_en-us.msi” **file

Step 5: Accept License Terms & Click Install button

https://howtodowithsharepoint.files.wordpress.com/2016/01/3.png?w=800

https://howtodowithsharepoint.files.wordpress.com/2016/01/4.png?w=800

https://howtodowithsharepoint.files.wordpress.com/2016/01/5.png?w=800

Step 6: Once the installation is complete, search for “SharePoint Online Management Shell” and launch it

https://howtodowithsharepoint.files.wordpress.com/2016/01/6.png?w=800

This completes the installation of SharePoint Online Management Shell on our machine.

Now let’s try a few of the operations to verify the installation of SharePoint Online PowerShell Module.

How to connect to SharePoint Online Services

Get current user credentials to connect to the SharePoint Online Services (assuming the user is having a valid SharePoint Online Account Credentials).

$userCredentials = Get-Credential

https://howtodowithsharepoint.files.wordpress.com/2016/01/7.png?w=800

https://howtodowithsharepoint.files.wordpress.com/2016/01/8.png?w=800

Import **“Microsoft.Online.SharePoint.PowerShell” **PowerShell module to the Management Shell Console.

Import-Module Microsoft.Online.SharePoint.PowerShell

https://howtodowithsharepoint.files.wordpress.com/2016/01/9.png?w=800Connect to SharePoint Online Service by supplying Tenant URL and User Credential to the Connect-SPOService command.

Connect-SPOService  -Url  https://prashantmbansal-admin.sharepoint.com -Credential $userCredentials

If you notice carefully the URL supplied to the URL Parameter in the above command, you will find “-admin” is added in the URL.

Actual URL of the Tenant is https://prashantmbansal.sharepoint.com but it is by convention that we much have to use **“-admin” **in the Host Header of URL in order to connect to the SharePoint Online Services.

That is why we have to specify the “https://prashantmbansal-admin.sharepoint.com” as Tenant URL.

https://howtodowithsharepoint.files.wordpress.com/2016/01/10.png?w=800

If we forgot to follow this convention we might encounter the following error:

https://howtodowithsharepoint.files.wordpress.com/2016/01/11.png?w=800

How to get the list of all the SharePoint Sites lies under current Tenancy

Once we are successfully able to Connect to SharePoint Online Services we can perform different operations on the site such as getting a list of all the SharePoint Sites available with in current tenancy by using the following command.

Get-SPOSite

https://howtodowithsharepoint.files.wordpress.com/2016/01/12.png?w=800

This is just the first step to Start with PowerShell Development for the SharePoint Online Sites, but the possibilities are limitless, especially when we can combine the SharePoint Client Object Model with PowerShell Scripting Environment.

We will explore the details on CSOM based Solutions driven by PowerShell Scripts in future articles.