Blog

Manage your Office 365 tenant on any platform with the Office 365 CLI

5 min read
5 min read

No matter if you’re using Windows, macOS or Linux, using the Office 365 CLI you can manage the settings of your Office 365 tenant.

Build solutions on any platform

In the past, building SharePoint solutions was exclusive to Windows. We would use Visual Studio, write .NET code and package it in CAB files. All that worked only on Windows. If Windows wasn’t your primary OS, you had to use a virtual machine. The toolset to build SharePoint solutions, from Visual Studio to dependencies – including SharePoint, was available only on Windows and there was no way around it. You had to use Windows as the operating system for your development machine.

With the introduction of Office web add-ins, Microsoft set the first step towards supporting developers on all platforms to extend the Office platform beyond what’s possible out of the box. Using market-standard web tools, such as Yeoman or Gulp, developers on macOS or Linux can use their native tools and build solutions for the Microsoft ecosystem.

Nowadays, more and more product teams at Microsoft embrace cross-platform support for extending their products. Using the same open-source tools, developers on any platform can extend SharePoint or Teams with additional functionality. And it makes perfect sense: why limit yourself to Windows, where there are thousands if not millions of web developers out there, who could build solutions for your product, if only you let them?

Is it truly for everyone?

The developer opportunity for SharePoint and Office 365 expands beyond Windows. But there are still some limitations that you have to take into account.

Office 365 is continuously evolving and more capabilities are being added to it every month. Often, these new features have to be configured first, before you can use them. And here is the catch: the only way to configure them is through PowerShell, on Windows.

Some people speak of a trend: building and supporting PowerShell cmdlets is significantly easier than building a web UI to offer the same configuration capabilities in Office 365. No matter if this is indeed the case or not, the bottom line is, if you build solutions for SharePoint and Office 365, you cannot abandon your Windows virtual machine just yet. At least not until recently.

Manage your Office 365 tenant on any platform

I’m in the same boat. I work on a Mac. I love how the SharePoint Framework allows me to build solutions on macOS and allows me to do it very efficiently. But every time I wanted to try one of the newly announced Office 365 features, I had to start my Windows VM.

PowerShell itself is available on other OSes than Windows. Unfortunately, SharePoint cmdlets have dependencies on libraries that are available only on Windows, so I doubt we will see these cmdlets available on other platforms any time soon. But with the continuously growing developer audience using OSes other than Windows, we need something better than running a Windows VM.

Over the last weeks, with advice from fellow MVPs Andrew ConnellElio Struyf and Erwin van Hunen, I’ve been working on building a cross-platform command-line interface that you can use to manage your Office 365 tenant on any platform. During the European SharePoint Conference 2017, I had the opportunity, to present an early version of the Office 365 CLI to a small group of attendees.

Waldek presenting the Office 365 CLI at the European SharePoint Conference 2017

Yesterday, we announced the public availability of the Office 365 CLI as a part of the SharePoint Patterns and Practices initiative.

Introducing the Office 365 CLI

Office 365 CLI is a cross-platform command-line interface, that you can use to manage your Office 365 tenant. You can install it with npm using:

npm i -g @pnp/office365-cli

or using yarn:

yarn global add @pnp/office365-cli

You can then start it by typing

office365

or

o365

for short

$ office365

o365$ _

Next, connect to your tenant using the

spo connect

command:

o365$ spo connect https://contoso-admin.sharepoint.com

After that, you can manage settings such as Office 365 CDN, tenant properties, apps installed in the tenant app catalog or custom actions.

See the Office 365 CLI in action:

You can find more information about the CLI at https://aka.ms/o365cli or in its GitHub repo.

What’s next

The Office 365 CLI has just been announced and has a long way to go to prove its worth and reach feature parity with SharePoint or PnP PowerShell cmdlets. But with your help, we can bridge that gap, one command at a time, and help developers on any platform extend SharePoint and Office 365.

In the future, you can expect to see the following features in the Office 365 CLI:

  • support for non-interactive mode, so that you can use it for building scripts
  • more commands for managing SharePoint Online configuration
  • Office 365 commands in the areas where configuration is not possible through the web UI

The Office 365 CLI is a part of the SharePoint Patterns and Practices initiative and is built and managed in the open on GitHub. We welcome community contributions and in fact, we have already had some great contributions from Wictor WilénErwin van Hunen and Velin Georgiev.

I’d encourage you, to give the Office 365 CLI a try and tell us what you think. With your constructive feedback and PRs, we can make it better and more useful for everyone building solutions for SharePoint and Office 365.

Sharing is caring!

Keep your Office 365 tenant governed at all times with our Customization Governance Solutions.

LEARN MORE

This blog post has been originally published on Waldek’s blog.

 

Subscribe to our newsletter