Office 365 CLI v1.19.0, v1.20.0 and v1.21.0

We've just published a new version of the Office 365 CLI with new commands for working with and managing Office 365 tenants and SharePoint Framework projects on any platform.

Manage Office 365 and SharePoint Framework projects on any platform

Office 365 CLI is a cross-platform CLI that allows you to manage various configuration settings of Office 365 and SharePoint Framework projects no matter which operating system or shell you use.

While building solutions for Office 365 expands beyond the Windows operating system, managing many of the platform settings is possible only through PowerShell on Windows. As more and more users work on non-Windows machines, it's inconvenient for them to have to use a Windows virtual machine to configure their tenants. With the Office 365 CLI, you can configure your tenant no matter which operating system you use. Additionally, using the Office 365 CLI, you can manage your SharePoint Framework projects.

May releases of the Office 365 CLI

May was a busy month with three releases of the Office 365 CLI. Netx to a regular, monthly release, we shipped two additional versions to support the updates to the SharePoint Framework for upgrading projects. But we have some cool new capabilities as well. Take a look.

Manage organizational news sites

As a part of the content management investments in SharePoint, Microsoft introduced the concepts of organizational news sites. The idea is, that administrators can designate the specific site as organizational news sites to surface news articles published on these sites to the rest of the organization.

For version 1.21.0 of the Office 365 CLI, David Calabro contributed a set of commands to manage organizational news sites.

To mark an existing site as an organizational news site, execute:

spo orgnewssite set --url https://contoso.sharepoint.com/sites/site1

To see the list of all sites marked as organizational news sites in your tenant, execute:

spo orgnewssite list

To unmark an organizational news site, execute:

spo orgnewssite remove --url https://contoso.sharepoint.com/sites/site1

For more information about managing organizational news sites using the Office 365 CLI, see the documentation at aka.ms/o365-cli.

Clone Microsoft Teams teams

More and more organizations use Microsoft Teams as their primary collaboration platform. Teams perfectly support the conversational aspects of collaboration and offer great capabilities for organizations to tailor them to their specific needs. If you'd like to create a new team, that resembles another team in your tenant, it would be a shame to have to do it manually. So to simplify the process, Joseph Velliah introduced in version 1.20.0 of the CLI a command to clone existing Microsoft Teams team.

To clone an existing Microsoft Teams team, execute:

graph teams clone --teamId 15d7a78e-fd77-4599-97a5-dbb6372846c5 --displayName "Library Assist" --partsToClone "apps,tabs,settings,channels,members"

For more information about managing Microsoft Teams teams using the Office 365 CLI, see the documentation at aka.ms/o365-cli.

Update Microsoft Teams team

As your organization uses Microsoft Teams more and more, the chances are that you will want to update their settings at some point, whether to change the description to better reflect the team's purpose or update its visibility or classification. In version 1.21.0, Rabia Williams introduced a command to update Microsoft Teams team's settings.

To update settings of a Microsoft Teams team, execute:

graph teams set --teamId '00000000-0000-0000-0000-000000000000' --visibility Private

For more information about managing Microsoft Teams teams using the Office 365 CLI, see the documentation at aka.ms/o365-cli.

Apply standard SharePoint themes

In the past already we introduced support for applying custom themes to modern SharePoint sites. For version v1.20.0 of the CLI, Anoop Tatti extended the spo theme apply command with support for standard SharePoint themes which is useful if you want to revert the look and feel of a particular site to a standard theme.

To apply a standard theme to your site, execute:

spo theme apply --name Blue --webUrl https://contoso.sharepoint.com/sites/project-x --sharePointTheme

For more information about working with modern themes using the Office 365 CLI, see the documentation at aka.ms/o365-cli.

Remove content types

If your organization has been using SharePoint for a long time, there is a chance that you have some unused content types that clutter the UI and complicate content management for users. To help you clean them up, David Calabro contributed to version 1.20.0 a command to remove content types.

To remove a content type, execute:

spo contenttype remove --id "0x01007926A45D687BA842B947286090B8F67D" --webUrl https://contoso.sharepoint.com

For more information about managing content types using the Office 365 CLI, see the documentation at aka.ms/o365-cli.

List Office 365 Groups and Microsoft Teams teams users

In the past already, we included support for listing users of Microsoft Teams teams which is invaluable for ongoing management and reporting the usage of teams in your organization. In version 1.20.0 Albert-Jan Schot extended the existing command to support retrieving users of both Microsoft Teams and Office 365 Groups.

To retrieve users of the specified Office 365 Group, execute:

graph o365group user list --groupId '00000000-0000-0000-0000-000000000000'

For more information about managing Microsoft Teams and Office 365 Groups using the Office 365 CLI, see the documentation at aka.ms/o365-cli.

Contributors

This release wouldn't be possible without the help of (in alphabetical order) Stefan Bauer, David Calabro, Velin Georgiev, Albert-Jan Schot, Anoop Tatti, Joseph Velliah and Rabia Williams. Thank you all for the time you chose to spend on the Office 365 CLI and your help to advance it!

Work in progress

Here are some things that we're currently working on.

More commands, what else

Office 365 is evolving and new capabilities are being released every day. With the Office 365 CLI, we aim to help you manage your tenant on any platform in a consistent way, no matter which part of Office 365 you interact with. While we keep adding new commands to the Office 365 CLI each release, we still barely scratched the surface with what's possible in Office 365. In the upcoming versions of the Office 365 CLI, you can expect us to add more commands across the different workloads in Office 365.

To make it easier for you to see how the CLI commands compare to the different PowerShell cmdlets, we've extended the comparison sheet with cmdlets for Flow, PowerApps and Teams.

Future improvements

CLI exists a year and a half now. Over time we picked up some things that we think we could improve. We've just refactored web requests and simplified logging in to Office 365. Next, we'll work on aligning the names of the commands and their arguments to be consistent and more intuitive. If you use the Office 365 CLI, we'd love to hear from you if there is anything else that we should consider.

Try it today

Get the latest release of the Office 365 CLI from npm by executing in the command line:

npm i -g @pnp/office365-cli

If you need more help getting started or want more details about the commands, the architecture or the project, go to aka.ms/o365cli. If you see any room for improvement, please, don't hesitate to reach out to us either on GitHub, on twitter with the #office365cli hashtag or on gitter.