Connecting to SharePoint Online with PowerShell


In my last post, I covered the basics of connecting to Exchange Online with PowerShell, including some optional modules to handle Azure Active Directory Rights Management and the Rights Management service.

Another module you might have to load allows you to manage SharePoint Online. I don’t use this very often because the PowerShell support for SharePoint Online (including OneDrive for Business) is a lot less functional (IMHO) than the Exchange equivalent. Thus, I find that most SharePoint management operations are directed towards the GUI.

The first thing to do is to download and install the SharePoint Online management shell. This package appears to assume that it will run on its own and not inside a PowerShell session where other tasks are performed. To get the SharePoint cmdlets to load, you need to include a line like this in your session (or PowerShell profile).

Import-Module “C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell”

Once that’s done, you can connect to SharePoint Online with a command like this:

Connect-SPOService –URL “https://office365exchangebook-admin.sharepoint.com/” –Credential $O365Cred

Notice that I use the same variable containing my Office 365 credentials as I use to connect to Exchange Online and Microsoft Online Services (see the previous post).

A list of the SharePoint Online cmdlets is available in TechNet. Don’t get too excited now..

Follow Tony @12Knocksinna

Advertisement

About Tony Redmond

Lead author for the Office 365 for IT Pros eBook and writer about all aspects of the Office 365 ecosystem.
This entry was posted in Cloud, Office 365, SharePoint and tagged , . Bookmark the permalink.

8 Responses to Connecting to SharePoint Online with PowerShell

  1. josefismael says:

    “Don’t get too excited now..”
    Pretty much the perfect attitude for SPO powershell capabilities 🙂

  2. Pingback: Weekly IT Newsletter – July 27-31, 2015 | Just a Lync Guy

  3. Pingback: NeWay Technologies – Weekly Newsletter #158 – July 30, 2015 | NeWay

  4. Pingback: NeWay Technologies – Weekly Newsletter #158 – July 31, 2015 | NeWay

  5. Hello!

    Do you have any idea on how to check-in all document on SharePoint online using Power shell please?

    By advance, thank you for your answer,

    JG

  6. Hello!

    Do you have any idea about how to check-in all documents on SharePoint online using Power Shell please?

    By advance, thank you for your help.

    JG

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.