PowerShell scripts for Microsoft 365

Your download is in progress and it will be complete in just a few seconds! If you face any issues, download manually here

Thank you for registering with ManageEngine.

We will send the download link to the registered email ID shortly.

Manage and Secure Microsoft 365 with M365 Manager Plus

  •  
  •  
  •  
  • By clicking 'Download 30-day free trial' you agree to processing of personal data according to the Privacy Policy.

How to manage users in Microsoft Teams using PowerShell

The Add-TeamUser cmdlet helps add a user to a team as its member or owner using PowerShell. The user is also added to the Microsoft 365 group that backs up the team.

Script:

  1.  Add-TeamUser
  2. -GroupId <String>]
  3. -User <String>]
  4. [-Role <String>]
  5. [<CommonParameters>]

Example:

1 Add-TeamUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -User sam@test.com

In this example, the user sam@test.com is added to the team and the specified group.

Cmdlet: Remove-TeamUser

This cmdlet removes a user from a team and its unified group. You can specify the role of the user as 'Member' or 'Owner'. If specified as 'Member', the user is completely removed from the team, even if he or she is a team owner. However if the role is specified as 'Owner' then the user is removed from the owner role but continues as a member of the team.

  1.  Remove-TeamUser
  2. -GroupId <String>]
  3. -User <String>]
  4. [-Role <String>]
  5. [<CommonParameters>]

Example:

1 Remove-TeamUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -User sam@test.com -Role Owner

In this example, the user sam@test.com is removed as an owner in the specified team but continues to be a member.

Working with PowerShell scripts can be error-prone as it involves complex scripting. It is also time-consuming as the changes take a while to reflect in the application.Though the command is executed immediately, one might need to keep the Microsoft Teams application open for at least an hour for the changes to be applied. M365 Manager Plus helps to simplify Teams management with its bulk management feature.

How can M365 Manager Plus help?

The user-friendly interface helps you add or remove users to teams in bulk by simply importing a CSV file. You can also create automated workflows in the tool to manage Teams. This will help save time and reduce your workload.

Steps to manage team members in bulk using M365 Manager Plus:

  1. Go to the Management tab.
  2. Navigate to Azure Active Directory > Group Management in the left pane.
  3. Select Group Member Management > Modify Microsoft 365 Group Members.
  4. Select the groups to which you would like to add or remove members.
  5. Select the required Microsoft 365 Tenant from the drop-down box.
  6. Import the required CSV file.
  7. Click  Import user(s).

You can also team members by running a name search in the Modify Microsoft 365 Group Members task as shown below.

Modify Microsoft 365 Group Members

To know more about managing Microsoft Teams using M365 Manager Plus, click here.

Why businesses choose M365 Manager Plus?

What our customers say

  • We can now effectively reconcile which licenses we are using in the organization and assign the cost to the business unit. We were also able to identify a number of license changes that could be put in place that reduced our total Microsoft 365 spending.

    Timothy Ransom
    Group IT/IS manager at The Eclipse Group, United Arab Emirates

  • M365 Manager Plus is valuable to our future business and, most importantly, it allows me to keep improving the level of service we provide.

    IT infrastructure manager
    Sunstar Suisse S.A.

  • Our firm purchased ManageEngine M365 Manager Plus to help us protect our business from email-borne cyberthreats. We are absolutely satisfied with the features and ease of use. It has surpassed our expectations.

    Insurance agent
    Security and risk management Gartner review

A holistic Microsoft 365 administration solution

One-stop solution for all your
Microsoft 365 administration needs!

Download now