Eric J Alexander

Formerly PirateEric, a blog about SharePoint and Office 365.

Setting Up PowerShell for Office 365

Getting the plumbing in order for successfully managing your tenant

Posted on 03 November 2016 by Eric in the category Administration
Tagged under: PowerShell

So you have a shiny new Office 365 tenant. Now what? If you are anything like me, the first thing you want to do is to start plugging away from PowerShell to administer your tenant. But how do you do that?

In this post, I am going to go through the process of getting your environment set up to start using PowerShell. This is focused more on the SharePoint side of the Office 365 suite.


In order to use PowerShell to talk to Office 365, you need PowerShell 3.0. I’m operating under the assumption that most of us in the business world are still running Windows 7. It has PowerShell 2.0 installed. What do we do? We install the Windows Management Framework to upgrade of course.

Windows Management Framework

The Windows Management Framework contains updates to the client and ISE. Download and install these components.

SharePoint Online Management Shell

The next thing we need to install is the SharePoint Online Management Shell. This contains all the DLLs needed to do our work.

SharePoint Online Client Components

The next required component is the SharePoint Online Client Components SDK. These are all the various DLLs that we need to use CSOM in PowerShell. The SharePoint Online Client Components have a very limited set of commandlets at our disposal if you have ever worked with an on premesis installation of SharePoint. We need these client DLLs to be able to create our own functions that bridge the gap. This is not necessary, installing the management shell above adds the appropriate CSOM dlls.

Optional Module, PnP PowerShell

If creating a slew of functions is not up your alley, there is a great publicly available project on GitHub called Office 365 Dev PnP PowerShell CmdLets. I won’t be covering this in great detail. By the time I knew it was out there, I already had a module of functions in the area of 3000 lines of code. I have used it for inspiration for gaps in our module.

Other Modules of Note

Depending on what workloads you are going to work with in Office 365, there are other PowerShell Modules you may want to install. They include, and are not limited to:

If video is more your thing, Shane Young has a video over on the Youtubes going over some of these concepts. Well worth a watch if you have time.

What’s next?

In my next post, I’ll go through a technique of wiring all these components into a PowerShell profile and detail some ways our team is effectively using a custom module shared via OneDrive.