CLI for Microsoft 365 v5.3
We’ve just published a new major version of the CLI for Microsoft 365 with new commands for working with and managing Microsoft 365 and SharePoint Framework projects on any platform.
CLI for Microsoft 365 is a cross-platform CLI that allows you to manage various configuration settings of Microsoft 365 and SharePoint Framework projects no matter which operating system or shell you use.
While building solutions for Microsoft 365 expands beyond the Windows operating system, managing many 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 use a Windows virtual machine to configure their tenants. With the CLI for Microsoft 365, you can configure your tenant no matter which operating system you use. Additionally, using CLI for Microsoft 365, you can manage your SharePoint Framework projects.
Following our monthly release cadence, we’ve released a new version of the CLI for Microsoft 365 with some new capabilities. Here are a few of the most noteworthy additions.
For the complete list of what’s new and changed, see the release notes.
We added 16 commands to manage Microsoft Planner with our CLI in the past couple of months. This latest beta introduces the ability to manage all aspects of managing Planner buckets.
To create a new Bucket in a Plan associated with a Group you can use:
m365 planner bucket add --name "My Planner Bucket" --planName "My Planner Plan" --ownerGroupName "My Planner Group"
You can list the Buckets of a Plan by using the bucket list command:
m365 planner bucket list --planName "My Planner Plan" --ownerGroupName "My Planner Group"
In some situations, you must break or restore the role inheritance for SharePoint Online lists or items. With this version we introduced 4 new commands to handle these use cases.
To break the role inheritance of a list, use:
m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listTitle "someList"
To restore it, use:
m365 spo list roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --listTitle "someList"
We extended the list of reporting commands in our CLI with the list of security alerts associated with a tenant:
m365 tenant security alerts list --vendor "Azure Sentinel"
When building apps for Microsoft 365, there are cases when you need an unattended process that runs either on a trigger (like a CI/CD pipeline triggered by a commit) or on schedule (like a monitoring process). Unattended processes typically use application-only permissions. Because there’s no user context, you’ll often authenticate to Microsoft 365 using managed identity or a secret like a certificate.
To help you set up Azure AD applications for unattended processes, we extended CLI for Microsoft 365 with support for setting certificates on Azure AD apps.
You can set a certificate when creating a new Azure AD app:
m365 aad app add --name 'My AAD app' --certificateDisplayName "Some certificate name" --certificateFile c:\temp\some-certificate.cer
You can also add a certificate to an existing Azure AD app:
m365 aad app set --certificateDisplayName "Some certificate name" --certificateFile c:\temp\some-certificate.cer
For more information about working with certificates and Azure AD apps using CLI for Microsoft 365, see the documentation.
These features are just the tip of the ice berg of what we’ve shipped in this version. Check out the release notes for the complete list of what’s new and improved.
This release wouldn’t be possible without the help of (in alphabetical order):
- Adam Wójcik
- Jasey Waegebaert
- Martin Lingstuyl
- Mathijs Verbeeck
- Michaël Maillot
- Milan Holemans
- Nanddeep Nachan
- Patrick Lamber
- Reshmee Auckloo
- Smita Nachan
- Veronique Lengelle
- Waldek Mastykarz
Thank you all for the time you chose to spend on CLI for Microsoft 365 and for your help to advance it!
Here are some things that we’re currently working on.
We’re constantly seeking for ways to let you work with CLI for Microsoft 365 more efficiently. In the past, we’ve shipped support for passing contents from files into options using the
@ token and using server-relative URLs with SharePoint commands. We’re continuing the improvement by introducing
@me tokens to let you pass information about the current user into options.
Many organizations use Microsoft Planner to keep track of their work. As you start working with Planner at scale, you’ll be likely to need to automate managing plans, buckets and tasks. In the previous versions of CLI for Microsoft 365 we introduced the base functionality for managing objects in Planner and we’ll keep extending it with additional features so that you have everything you need.
When building apps for Microsoft 365, next to your code, you also need to manage how your app is exposed to Microsoft 365. You need to register your application in Azure Active Directory, and depending what type of app you build, you might need to deploy it to an app catalog as well. All these properties are managed in different locations and we’re thinking of ways that we could simplify it for you.
Get the latest release of CLI for Microsoft 365 from npm by executing:
npm i -g @pnp/cli-microsoft365
Alternatively, you can get the latest release from Docker by executing:
docker run --rm -it m365pnp/cli-microsoft365:latest
If you need more help getting started or want more details about the commands, architecture, or project, go to aka.ms/cli-m365. And if you see any room for improvement, please, don’t hesitate to reach out to us either on GitHub or Twitter.