Manage Microsoft 365 and SharePoint with CLI for Microsoft 365

If you’re an admin in charge of Microsoft 365, using CLI for Microsoft 365 can make you more productive. While PowerShell remains a go-to tool for many admins to manage and tweak Microsoft and SharePoint configurations, not everyone uses a Windows device all the time. CLI for Microsoft 365 is a cross-platform tool that can be used on all operating systems. CLI for Microsoft 365 can also be used to manage settings on your SharePoint Framework projects.

[tg_youtube video_id=”cRYmlkxOPP8″]

Monthly releases

Even if you’ve been using CLI for Microsoft 365, be aware Microsoft releases new versions monthly. Each version adds some nifty new functionality. If you haven’t used the tool, here’s the command to install it:

npm i -g @pnp/cli-microsoft365

Once installed, use the login command to get started:

m365 login

And you can see a list of available commands by typing this at the command prompt:

m365 help

As for what’s new, Microsoft’s Gary Trinder gave users a look under the hood at v3.12 in a recent blog post.

Among the new commands is CLI doctor, a diagnostic tool that Gary says will give you “information needed to triage and debug CLI issues without exposing any security-sensitive details.” Here’s the command:

m365 cli doctor

CLI for Microsoft 365
Microsoft

There are also several new commands to help you manage Microsoft Planner. For example, you can create new buckets with this simple command:

m365 planner bucket add --name "My Planner Bucket" --planName "My Planner Plan" --ownerGroupName "My Planner Group"

Similarly, you can see information about your existing Planner buckets with this command:

m365 planner bucket list --planName "My Plan" --ownerGroupName "My Group"

Get OneDrive information

For users of OneDrive, this command gives you information about OneDrive sites in your Microsoft 365 tenant:

m365 onedrive list

Where to find CLI for Microsoft 365 scripts

Best of all, the number of scripts using CLI for Microsoft 365 will continue to grow as admins and other users share their creations. Microsoft is collecting scripts at this GitHub site. The site includes scripts for several Microsoft products, including Azure Active Directory, Microsoft Teams, Microsoft Graph, and SharePoint Online.

Featured image: Shutterstock

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top