CLI for Microsoft 365 v10
We have just published a new major version of CLI for Microsoft 365 v10. CLI for Microsoft 365 is a cross-platform command-line tool that allows you to manage your Microsoft 365 tenant and SharePoint Framework projects. This major release introduces several new commands that will enhance the quality of your Microsoft 365 experience as well as numerous breaking changes.
Explore the release notes to discover an array of exciting features and improvements that will revolutionize your Microsoft 365 journey.
The new major version of CLI for Microsoft 365 – v10
We know, another major release! But this one is not an ASAP reaction to a breaking change we needed to adapt to. This one is is the longly awaited and planned release that will introduce a lot of helpful improvements to our product. The list of breaking changes is quite long but it introduces a lot of helpful and necessary improvements to CLI for Microsoft 365 and also aligns it with the the latest changes and naming updates of Microsoft 365 products and apps.
A good example of necessary changes that were done in order to align with Microsoft 365 were
- removal of the
AAD
alias, which means from now on we will be using only theEntra
word when referring to Entra ID - We also removed aliases to good old Yammer and therefore leaving only Viva Engage to align all our commands with the current state of Microsoft 365
We also introduced breaking changes that will greatly improve some functionalities of our product. For example, we updated the API endpoints that were used in spo folder move and spo folder copy commands so that now it will be possible to copy/move larger folders between site collections. As we now use different APIs we also need to adapt our command options to what is supported in the new endpoints.
Similar improvements are introduced to spo file copy and spo file move commands. We also updated those commands to new endpoints to ensure the command’s functionality and reliability.
You may find more details about those changes reading the Updated commands for file and folder operations
Other breaking changes were introduced to align some of our commands with our conventions so that we are consistent and follow similar approaches in all places. For example we:
- added
--force
option to spo site appcatalog remove - updated the purpose of option
displayName
for entra m365group set command
This is just the tip of the iceberg of the necessary and longly awaited updates we introduced to CLI for Microsoft 365 that will greatly improve its usage and align it with Microsoft 365!
To help you go over all the changes and upgrade to v10, we prepared a summary of the breaking changes and the recommended actions. For more information see the v10 Upgrade Guidance on our docs.
For the complete list of what’s new and changed, see the release notes.
What else is new
New SharePoint Premium commands
This major release also introduces a brand new spp model list command which will allow you to retrieve the list of unstructured document processing models.
The usage is as always very easy and in order to retrieve a list of SharePoint Premium unstructured document processing models on the content center site, just run:
m365 spp model list --siteUrl https://contoso.sharepoint.com/sites/ContentCenter
For more information check the following resources:
New Viva engage command
We don’t stop enhancing the Viva Engage area with new commands that will help you automate and manage this part of Microsoft 365. In this release, we added a command that will allow you to get all users within a specified Microsoft 365 Viva Engage community.
To list all admins from a community specified by display name run:
m365 viva engage community user list --communityDisplayName "All company" --role Admin
Or you may get the list of members by specifying the group ID by running:
m365 viva engage community user list --entraGroupId b6c35b51-ebca-445c-885a-63a67d24cb53 --role Member
For more information check the following resources:
Publish your SharePoint Online Modern page
This is a straightforward and simple thing that is missing in CLI for Microsoft 365, I mean, was missing till now.
Now you may publish a modern page by running:
m365 spo page publish --webUrl https://contoso.sharepoint.com/sites/Marketing --name "Style guide.aspx"
For more information check the following resources:
Update your SharePoint folder sharing link
We already have a lot of commands that allow you to automate and manage SharePoint Online folder-sharing links and in this release we added another one that will now allow you to update a sharing link of a folder.
For example to update the expiration date-time of an anonymous sharing link for a folder specific by folder ID, simply run:
m365 spo folder sharinglink set --webUrl https://contoso.sharepoint.com/sites/demo --folderId daebb04b-a773-4baa-b1d1-3625418e3234 --id 7c9f97c9-1bda-433c-9364-bb83e81771ee --expirationDateTime '2022-11-30T00:00:00Z'
Or to update the expiration date-time of an anonymous sharing link for a folder specific by folder URL, run:
m365 spo folder sharinglink set --webUrl https://contoso.sharepoint.com/sites/demo --folderUrl /sites/demo/shared%20documents/Folder --id 7c9f97c9-1bda-433c-9364-bb83e81771ee --expirationDateTime '2022-11-30T00:00:00Z'
For more information check the following resources:
New SharePoint admin management command
In this release, we also introduced a new command that allows you to retrieve the information about default site group membership.
It is as easy as:
m365 spo tenant site membership list --siteUrl https://contoso.sharepoint.com
For more information check the following resources:
What’s changed
Besides all these new commands, we’ve also made some changes to some existing commands. A few bugs have been fixed and the codebase has been polished. Let’s have a closer look at some of the updates that stand out the most.
Extended login
command with --ensure
option
We updated our login
command adding a new option that ensures that the user is signed in. If the user isn’t signed in, it initiates the login flow. This option will allow you to update and simplify your scripts as now you will no longer need to run the m365 status
command first to ensure that you are logged in and if not run the login
command which is typically the first thing we do in almost every script. Now you may do all that by simply running m365 login --ensure
.
Enhanced the spo list remove
command with --recycle
option
We improved the spo list remove with a new --recycle
option that when used will send the list to the recycle bin instead of permanently deleting it.
Renamed the default CLI for Microsoft 365 app registration created during m365 setup
Not so long ago we updated the default behavior of the login command which now requires you to provide an app registration which will allow CLI for Microsoft 365 to sign in to your tenant. You may read more details about this change in previous major release blog post. Along with this change we updated the m365 setup
command so that it now also allows you to create the required app registration on your tenant along with all required settings and selected set of permissions. In this release we updated the default name of this app to ‘CLI for M365’, previously it was ‘CLI for Microsoft 365’. Unfortunately, it turned out that the word ‘Microsoft’ in your app registration name blocks it from becoming multitenant. That is why in order to avoid this unnecessary problem we updated the name.
Upcoming changes
Curious about what lies ahead? We are excited to share some of our ongoing projects and initiatives.
Right now, there are over 50 opened PRs with new awesome features that will soon be added to CLI for Microsoft 365, and 89 issues that are up for grabs. We’re working hard to bring you even more exciting features and improvements in the next release.
But we don’t stop there. We value your input and ideas. If you have any suggestions for new commands, don’t hesitate to share them with us. Create a new issue on our GitHub Issues list or join our vibrant community Discord server to engage in discussions.
Sharing is Caring!
Contributors
We want to extend our heartfelt appreciation to the incredible individuals who have made this release possible. Without their valuable contributions and dedication, CLI for Microsoft 365 wouldn’t be where it is today. Let’s give a round of applause to the following contributors (in alphabetical order):
- Adam Wójcik
- Can Arslan
- Jasey Waegebaert
- Martin Lingstuyl
- Mathijs Verbeeck
- Michał Kornet
- Milan Holemans
- Nanddeep Nachan
- Nico De Cleyre
- Saurabh Tripathi
- Shantha Kumar T
- Waldek Mastykarz
High fives
We would like to give a big shoutout and high fives to the amazing individuals who have shared their invaluable feedback and ideas for improving CLI for Microsoft 365. We greatly appreciate your engagement and contribution to the growth of our platform. Let’s celebrate the following users (in alphabetical order) for taking the time to provide us with their insights:
Get started today!
Experience the power of the CLI for Microsoft 365 by getting the latest release from npm:
npm i -g @pnp/cli-microsoft365
Alternatively, you can access the latest release from Docker:
docker run --rm -it m365pnp/cli-microsoft365:latest
Need more information?
For additional guidance on getting started or to explore detailed information about commands, architecture, or the project itself, visit aka.ms/cli-m365.
Stay connected!
We value your feedback and are eager to hear from you. If you have any suggestions for improvement or want to engage with our community, you can reach out to us on GitHub, Discord, or X, or LinkedIn. Don’t hesitate to connect with us. Your input plays a vital role in shaping the future of CLI for Microsoft 365.