다음을 통해 공유


Office 365: How to Configure PowerShell for O365

Since most of the SharePoint implementation paradigms are moving fast towards Cloud-based hosting, it is now becoming crucial to be hands-on with the respective Cloud counterparts of On Premise SharePoint Implementations.

We will see the details on how to setup a machine to start working with “SharePoint Online Management Shell” in the upcoming articles but in this article we will see the details on how to setup machine to start working with PowerShell in O365. Since SharePoint Online is the part of Office 365 Platform it is necessary to have some understanding of basic operations on O365 first.

Let’s first discuss the prerequisites for configuring PowerShell for O365.

Prerequisites

We need to install the following two components in order to get PowerShell working for O365 right from your Windows PowerShell console or SharePoint Management Shell console:

  • Microsoft Online Services Sign-In Assistant
  • Windows Azure Active Directory Module for Windows PowerShell

** **

Install Microsoft Online Services Sign-In Assistant

You can download this component from the following URL:

http://www.microsoft.com/en-us/download/details.aspx?id=41950

  • Visit the URL and click Download

https://howtodowithsharepoint.files.wordpress.com/2015/12/114.png?w=800

  • Select the 64-Bit.msi file as show below

https://howtodowithsharepoint.files.wordpress.com/2015/12/27.png?w=800

  • Click Run once you get the popup notification

https://howtodowithsharepoint.files.wordpress.com/2015/12/32.png?w=800

  • Let the installation go until no further screen appears

https://howtodowithsharepoint.files.wordpress.com/2015/12/42.png?w=800

  • Accept the License Terms and click Install

https://howtodowithsharepoint.files.wordpress.com/2015/12/52.png?w=800

  • Allow the Installation by clicking Yes

https://howtodowithsharepoint.files.wordpress.com/2015/12/62.png?w=800

  • Let the installation run and wait for further instructions

https://howtodowithsharepoint.files.wordpress.com/2015/12/72.png?w=800

https://howtodowithsharepoint.files.wordpress.com/2015/12/82.png?w=800

  • Click Finish to exit the Installer on completion

https://howtodowithsharepoint.files.wordpress.com/2015/12/92.png?w=800

With this, we are done with the installation of Microsoft Online Services Sign-In Assistant.

Now let’s see the steps involved in installing the next component.

Install Microsoft Azure Active Directory Module for Windows PowerShell

You can download this component from the following URL:

http://go.microsoft.com/fwlink/p/?linkid=236297

  • Visit the Url
  • Choose Run once get the popup notification

https://howtodowithsharepoint.files.wordpress.com/2015/12/102.png?w=800

  • Click Next to continue with the installation

https://howtodowithsharepoint.files.wordpress.com/2015/12/113.png?w=800

  • Accept the License agreement and click Next to continue with the installation

https://howtodowithsharepoint.files.wordpress.com/2015/12/122.png?w=800

  • Choose the installation Path or continue with the defaults
  • Click Next to continue

https://howtodowithsharepoint.files.wordpress.com/2015/12/132.png?w=800

  • Click Install to start the installation

https://howtodowithsharepoint.files.wordpress.com/2015/12/142.png?w=800

  • Allow the installation by clicking Yes

https://howtodowithsharepoint.files.wordpress.com/2015/12/152.png?w=800

  • Let the installation run and wait for further instructions

https://howtodowithsharepoint.files.wordpress.com/2015/12/163.png?w=800

  • Click Finish to exit the Installer on completion

https://howtodowithsharepoint.files.wordpress.com/2015/12/172.png?w=800

We are done with the installation part. The next thing would be to verify if the components are installed as expected and SharePoint Online Management Shell is responding.

Verify configuration of SharePoint Online Management Shell

This article assumes you have a valid O365 Developer Account as we need it in the upcoming steps.

If you don’t have the O365 Developer Account yet, you can create it by navigating to https://products.office.com

Follow the steps below in order to verify the “SharePoint Online Management Shell” is responding as expected:

  • Launch SharePoint 2013 Management Shell

https://howtodowithsharepoint.files.wordpress.com/2015/12/182.png?w=800

  • Run the following commands:

Import-Module MSOnline

https://howtodowithsharepoint.files.wordpress.com/2015/12/192.png?w=800

$userCredentials = Get-Credential

Enter your O365 Credentials when asked for

https://howtodowithsharepoint.files.wordpress.com/2015/12/202.png?w=800

Connect-MSOLService -Credential $userCredentials

Try connecting to MSOLService using the above command and see if we are successful

https://howtodowithsharepoint.files.wordpress.com/2015/12/212.png?w=800

If the Command Prompt returns without error it means we are able to connect to the service successfully

https://howtodowithsharepoint.files.wordpress.com/2015/12/222.png?w=800

Get-MSOLUser

Try exporting the Active User using the above command and see if it is responding with the correct user information

https://howtodowithsharepoint.files.wordpress.com/2015/12/233.png?w=800

We can see user information is returned by this command is showing PowerShell for O365 is configured as expected

https://howtodowithsharepoint.files.wordpress.com/2015/12/241.png?w=800

We can further verify this information by logging into Office 365 Admin Center:

https://howtodowithsharepoint.files.wordpress.com/2015/12/252.png?w=800

 

  • On the Home page select the Admin Center tile

https://howtodowithsharepoint.files.wordpress.com/2015/12/261.png?w=800

  • Once you reach the Admin Center Page, select Users >Active Users from left navigation

https://howtodowithsharepoint.files.wordpress.com/2015/12/271.png?w=800

We can see the same user information as returned by the command. This ensures that we are done with the configuration of PowerShell for Office 365.

In upcoming articles, we will see some more useful commands that work with SharePoint Online & Office 365.

Hope you find it helpful.