Connecting to SharePoint Online with PowerShell

Published by

on


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

8 responses to “Connecting to SharePoint Online with PowerShell”

  1. josefismael Avatar
    josefismael

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

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

    […] · Connecting to SharePoint Online with PowerShell […]

  3. […] · Connecting to SharePoint Online with PowerShell […]

  4. […] · Connecting to SharePoint Online with PowerShell […]

  5. Julien GARRIGUE Avatar

    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. Julien GARRIGUE Avatar

    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

    1. Tony Redmond ("Thoughts of an Idle Mind") Avatar

      I’m afraid not. I don’t really manipulate documents using PowerShell… Something to look into after vacation though!

      1. Julien GARRIGUE Avatar

        OK. Thanks for your reply.

Leave a reply to NeWay Technologies – Weekly Newsletter #158 – July 30, 2015 | NeWay Cancel reply

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