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