Office 365 CLI v1.14.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.
New version of Office 365 CLI - v1.14.0
Following our monthly release cadence, we've released a new version of the Office 365 CLI with some new capabilities.
Manage Microsoft Teams
More and more organizations use Microsoft Teams to facilitate communication and collaboration. As Teams are gaining popularity, you might need to manage some of their aspects like configurations or members in an automated way. In this release of the Office 365 CLI, we're happy to provide you with a set of new commands for working with Microsoft Teams teams.
Manage Microsoft Teams apps
For many organizations Microsoft Teams is the centerpiece of collaboration. As such, they extend Teams to their needs with apps. Elio Struyf and Vardhaman Deshpande contributed a set of commands to manage Microsoft Teams apps.
To add a Microsoft Teams app, execute:
graph teams app publish --filePath ./teams-manifest.zip
To update an app, execute:
graph teams app update --id 83cece1e-938d-44a1-8b86-918cf6151957 --filePath ./teams-manifest.zip
To see available apps, execute:
graph teams app list
And to remove an app from the catalog, execute:
graph teams app remove --id 83cece1e-938d-44a1-8b86-918cf6151957
Manage Microsoft Teams team users
For this release of the Office 365 CLI, Albert-Jan Schot continued his work related to managing Microsoft Teams teams' users contributing commands to remove users and change their roles.
To change user's role in the specified team, execute:
graph teams user set --teamId '00000000-0000-0000-0000-000000000000' --userName 'email@example.com' --role Owner
To remove a user from a Microsoft Teams team, execute:
graph teams user remove --teamId '00000000-0000-0000-0000-000000000000' --userName 'firstname.lastname@example.org'
Get information about Microsoft Teams team channels
For this release of the Office 365 CLI, Rabia Williams contributed a command to get information about channels of the specified Microsoft Teams team.
To get a list of all channels in the specific Microsoft Teams team, execute:
graph teams channel list --teamId 00000000-0000-0000-0000-000000000000
For more information about working with Microsoft Teams teams using the Office 365 CLI, see the documentation at aka.ms/o365-cli.
Manage SharePoint site designs
Site designs are the new way organizations can build custom site templates in Office 365. Using site designs, they can align with the preferred look and feel and structure as defined in the organizational information architecture.
In this version of the Office 365 CLI, we introduced a number of commands for keeping track of site designs applied to sites.
To get information about site designs applied to the specific site, execute:
spo sitedesign run list --webUrl https://contoso.sharepoint.com/sites/team-a
To get information about site scripts executed for the specific site design, execute:
o365 spo sitedesign run status get --webUrl https://contoso.sharepoint.com/sites/team-a --runId b4411557-308b-4545-a3c4-55297d5cd8c8
To list site designs scheduled for execution on the specific site, execute:
o365 spo sitedesign task list --webUrl https://contoso.sharepoint.com/sites/team-a
To get detailed information about the specific site design scheduled for execution, run:
o365 spo sitedesign task get --taskId 6ec3ca5b-d04b-4381-b169-61378556d76e
For more information about working with site designs using the Office 365 CLI, see the documentation at aka.ms/o365-cli.
Manage in-place records management and list labels
Many organizations use SharePoint as a record management system. To meet their compliance requirements, they need to configure SharePoint's features in a specific way.
For this version of the Office 365 CLI, Velin Georgiev contributed a command to enable and disable in-place record management in SharePoint as well as a command to set compliance label on a list. Rabia Williams contributed a command to retrieve the list's label.
To enable in-place records management on a site collection, execute:
spo site inplacerecordsmanagement set --siteUrl https://contoso.sharepoint.com/sites/team-a --enabled true
To set a label on a list, execute:
spo list label set --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle 'Documents' --label 'Confidential'
To retrieve the label set on the specific list, execute:
spo list label get --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle ContosoList
For more information about managing records management configuration and data classification using the Office 365 CLI, see the documentation at aka.ms/o365-cli.
Manage list view fields
By configuring list views, users can more easily find the relevant information. As a part of provisioning of your application, you might want to provision specific views in your lists. For this release of the Office 365 CLI Laurent Sittler continued his work on commands for managing list views contributing commands to add and remove fields to list views.
To add a field to an existing list view, execute:
spo list view field add --webUrl https://contoso.sharepoint.com/sites/project-x --fieldTitle 'Custom field' --listTitle Documents --viewTitle 'All Documents'
To remove a field from a list view, execute:
spo list view field remove --webUrl https://contoso.sharepoint.com/sites/project-x --fieldTitle 'Custom field' --listTitle Documents --viewTitle 'Custom view'
For more information about managing list views using the Office 365 CLI, see the documentation at aka.ms/o365-cli.
Bug fixes and improvements
Next to a number of new commands, this release of the Office 365 CLI contains a number of bug fixes and improvements.
Fixed bug in retrieving Flows
Using the Office 365 CLI you can list the Flows available in your environment. It turned out however, that in some cases, the CLI would show only some of them. In this version of the CLI, we updated the azmgmt flow list command so that it lists all Flows in the given environment.
Applying large site designs
In the previous version of the Office 365 CLI we've added support for applying SharePoint site designs. The SharePoint API that made applying site designs possible was initially restricted with regards to how big the design to apply could be. As the complexity of site designs increased, Microsoft released a new API that allows you to apply site designs without any restrictions. In this version of the Office 365 CLI, we extended the existing spo sitedesign apply command with support for large site designs.
Provisioning web parts with dynamic data
In a recent version of the SharePoint Framework, Microsoft released dynamic data: the ability to connect web parts and extensions to each other to exchange data. For this release of the Office 365 CLI, Mark Powney extended the existing spo page clientsidewebpart add command to support provisioning web parts preconfigured with dynamic data.
Configuring modern UI settings
Microsoft keeps investing in the modern SharePoint UI, regularly adding more capabilities. Recently, we got the ability the configure the layout and background of the site header and the site menu mode. This latest version of the Office 365 CLI allows you to configure these elements using the spo web set command.
This release wouldn't be possible without the help of (in alphabetical order) Vardhaman Deshpande, Velin Georgiev, Mark Powney, Albert-Jan Schot, Laurent Sittler, Elio Struyf 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.
Office 365 CLI exists over a year now. Over time we picked up some things that we think we could improve. We started to keep track of the ideas that we have for what we could do better to make the CLI easier to use. At this stage these are just ideas. Nothing is planned yet. If you use the Office 365 CLI, we'd love to hear from you if these improvements would be worth the effort and if there is anything else that we haven't considered.
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.