CLI for Microsoft 365 v7.2
Introducing the latest release of CLI for Microsoft 365
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 minor release introduces a number of new administrative commands as well as a ton of awesome improvements.
Explore the release notes to discover an array of exciting features and improvements that will revolutionize your Microsoft 365 journey.
With this release, we’ve introduced a new group of commands that allows you to manage administrative units. An administrative unit is a Microsoft Entra resource that can be a container for other Microsoft Entra resources. It may contain only users, groups, or devices.
To retrieve a list of administrative units
m365 aad administrativeunit list
To create an administrative unit with a specific display name
m365 aad administrativeunit add --displayName 'Marketing Division'
To get information about the administrative unit by its display name
m365 aad administrativeunit get --displayName 'Marketing Division'
To remove an administrative unit by it display name
m365 aad administrativeunit remove --displayName 'Marketing Division'
For more information check the following resources:
- m365 aad administrativeunit list
- m365 aad administrativeunit add
- m365 aad administrativeunit get
- m365 aad administrativeunit remove
Thanks to a recent adjustment to MS Graph you may now use the profileCardProperty resource to show additional properties from Microsoft Entra ID on the profile card for a user either by: making additional attributes visible or adding custom attributes. In this minor release, we introduced all commands that will allow you to manage profile card properties.
To list all profile card properties
m365 tenant people profilecardproperty list
To add a custom extension attribute Cost Center as a profile property to the profile cards properties
m365 tenant people profilecardproperty add --name customAttribute1 --displayName 'Cost Center'
To retrieve information about a specific profile card property
m365 tenant people profilecardproperty get --name customAttribute1
To update a custom extension attribute with translations
m365 tenant people profilecardproperty set --name customAttribute1 --displayName "Cost Center" --displayName-nl-NL "Kostencentrum" --displayName-de "Kostenstelle"
To remove the UPN as a profile property from the profile cards
m365 tenant people profilecardproperty remove --name UserPrincipalName
For more information check the following resources:
- m365 tenant people profilecardproperty list
- m365 tenant people profilecardproperty add
- m365 tenant people profilecardproperty get
- m365 tenant people profilecardproperty set
- m365 tenant people profilecardproperty remove
SharePoint Framework (SPFx) allows you to build solutions for Microsoft Teams, Microsoft Viva, Outlook, the Microsoft 365 app and SharePoint. v1.18.2 of SPFx introduced a minor improvement that allows you to use the latest version of yeoman.
To benefit from this you may upgrade your existing projects using the CLI for Microsoft 365.
Important: CLI for Microsoft 365 won’t upgrade your project. Instead, it will provide you with a report that you can use to upgrade your project yourself.
To upgrade your SPFx projects to v1.18.2, run the following command:
m365 spfx project upgrade --toVersion 1.18.2 --output md > report.md
You can also request a more interactive report built on top of the VSCode CodeTour extension, by running:
m365 spfx project upgrade --toVersion 1.18.2 --output tour
We’ve also updated other SPFx-related commands to support SPFx v1.18.2 like the
doctor command which allows you to validate the correctness of a SharePoint Framework project.
To validate if your project is correctly set up and save the findings in a Markdown file
m365 spfx project doctor --output md > "doctor-report.md"
CLI for Microsoft 365 is interactive by default. This means that you only need to type the command, hit enter and CLI will do the rest. It will ask for a minimal set of required information to execute the command. It will even help you determine the correct result from a list of found items. Now we extended this behavior with an additional improvement. Till now you always needed to type the option value even if some only allowed specific values from a list of possible options. Now CLI will present you a list of possible choices for you to select the wanted option. This means less typing and fewer mistakes.
If you are eager to go over all of the details and improvements added in this release, do not hesitate to check out the release notes to find out more.
Curious about what lies ahead? We’re excited to share some of our ongoing projects and initiatives.
Right now, there are over 90 issues that are actively being developed and 61 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.
Together, let’s shape the future of CLI for Microsoft 365 and unlock even greater possibilities.
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):
- Aaron Junker
- Adam Wójcik
- Jasey Waegebaert
- Joel Rodrigues
- Martin Lingstuyl
- Martin Machacek
- Milan Holemans
- Nanddeep Nachan
- Nico De Cleyre
- Reshmee Auckloo
- Saurabh Tripathi
- Tobias Maestrini
- Waldek Mastykarz
We express our deepest gratitude for the time and effort you have invested in CLI for Microsoft 365, improving its progress and enriching its capabilities. Your contributions have played a significant role in advancing this project and empowering users worldwide. Thank you for your commitment and valuable assistance!
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:
Experience the power of 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
For additional guidance on getting started or to explore detailed information about commands, architecture, or the project itself, visit aka.ms/cli-m365.
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. Don’t hesitate to connect with us. Your input plays a vital role in shaping the future of CLI for Microsoft 365.