This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.
In our last post we saw how to Export conversations from Microsoft Teams Channels using the CLI for Microsoft 365.
We will continue our journey with the most popular sample scripts created for the CLI for Microsoft 365. This time we will show you how to add and remove users to Microsoft Teams in bulk. The original script was created by our community member Joseph Velliah.
The script requires a CSV file with different parameters:
- groupMailNickname: the mail alias used for the Microsoft 365 Group associated to the current team
- userPrincipalName: the UPN of the user that should be processed
- role (owner, member): the role of the user. Can be owner or member. Keep it empty if you want to remove a user
- operation (add, remove): operation to execute
The script in question looks as follows:
You can find this and many more samples on how to use the CLI for Microsoft 365 in our official samples section.
What is the CLI for Microsoft 365?
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 of the 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 have 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.
Try it today
Get the latest release of the CLI for Microsoft 365 from npm by executing:
If you need more help getting started or want more details about the commands, the architecture or the project, go to aka.ms/cli-m365.