Articles

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.

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

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

Peter King

Peter King has been Managing Editor at TechGenix since July 2016. As a technology editor, reporter, and columnist, he has worked at some of the biggest U.S. newspapers and technology magazines, directing coverage of breaking news stories and steering award-winning projects from conception to publication. As a professor of Journalism at Hofstra University in New York, he has taught and inspired the next generation of journalists.

Share
Published by
Peter King

Recent Posts

Low-code/no-code: Benefits, differences, drawbacks, and the future

Low-code/no-code provides a modular approach for developers — and even non-developers — to produce apps…

1 day ago

Are you human or robot? How CAPTCHAs know

CAPTCHAs may be an annoying part of web surfing, but they serve a purpose for…

2 days ago

Pixel 6 unveiled: Finally, a smartphone winner for Google

Google hasn’t had a lot of success with its past smartphones, but the Pixel 6…

2 days ago

Cross-account container takeover: All about this little-known cloud threat

Palo Alto Networks uncovered a cross-account container takeover exploit that could threaten users of the…

2 days ago

IgniteTech adds IT management software to enterprise portfolio

Software maker IgniteTech has added 12 products to its enterprise portfolio, including several focused on…

3 days ago

Olympus Global issues warning about potential cyberattack

Medical systems maker Olympus Global, out of an abundance of caution, is warning the public…

3 days ago