Connect all your carriers & calling platforms to Teams with
How To Automate Your Microsoft Teams Team Memberships

How To Automate Your Microsoft Teams Team Memberships

Aside from being a mouthful to say, Microsoft Teams team memberships are a bit of a manual nightmare. 

Every time you need to add a new (or existing in some cases) user to a team, it requires searching for a team, opening up the settings, and typing the user’s name to invite them to join a team. 

On the face of it, this sounds like it takes a few seconds, maybe a minute, to locate the team and add the user. 

Note: For absolute clarity in the tongue twister of a blog post, we’ll refer to Teams (the platform) with a capital T and teams (the place you house channels and members) with a lower case t. 

The traditional way to assign team memberships 

There are two main ways to assign team memberships in Microsoft Teams. 

1 – How to manually add users to a Microsoft Teams team 

The process looks like this: 

  1. Search for the team, click the icon and choose Add member
How to manually add users to a Microsoft Teams team 
  1. Start typing the user’s name or email address and choose the right user. 
How to manually add users to a Microsoft Teams team 
  1. Click Add then choose whether you want this user to be a Member or an Owner of the team. 
How to manually add users to a Microsoft Teams team 
  1. Hit Close and you’ve successfully added them to the team. 

This process on a one-off basis is absolutely fine. It takes a minute and you can add one user to one team. 

But what about when you need to a new user to multiple teams?  

Take yourself as an example. How many teams do you have access to right now? 

Sure, you have created and joined these as you’ve needed to over time.  But to provide a new user with all the access they need on day one through to day 101, it’s best practice to give them access to all the teams they need. 

We’re not saying give them access to every team. That would scare any new employee off.  

But providing them what they need so they don’t have to go searching, raise a support ticket, or be in the dark about projects and topics should be table stakes for any company wanting to provide a best-in-class Teams experience. 

2 – How to add users to a Teams team using PowerShell scripts 

If you have a bunch of new, existing, or even guest users that you need to add to a team, you can save time by running a PowerShell script. This means you won’t have to sit there typing everyone’s name to add them to a channel. 

Before you get started, there are some pre-requisites for this process: 

  • Must have access to the Microsoft Teams PowerShell module 
  • Must have a CSV file with your users ready to upload 
  • Must have “Owner” rights for the teams you wish to add users to 

Assuming you have these, here’s how to bulk add users to a team. 

Step 1: Connect to Microsoft Teams using PowerShell 

To begin, let’s establish a connection to Microsoft Teams from PowerShell. You can do this by using the Connect-MicrosoftTeams cmdlet. 


You’ll be prompted to log in so use your Microsoft Teams credentials. 

This login prompt is Multi-Factor Authentication (MFA) aware, so even if your account has multi-factor authentication enabled, you’ll be able to log in to PowerShell and connect to Microsoft Teams.  

Step 2: Get the Group ID of the team 

When a team is created in Teams, an associated Microsoft 365 group is also created in the background.  

This group serves as the backbone for each team. To manage the team, we need to obtain the ID of the associated group.  

Do this by running this command:  

# Get Team ID from Display Name 

$TeamID = Get-Team | Where {$_.DisplayName -eq "Learning Portal"} | Select -ExpandProperty GroupID 

# Get Team ID from Display Name 

If you are unsure about the display name of any team, you can use the Get-Team cmdlet to get all teams in your environment: 

# Get All Teams 


Step 3: Create a CSV file with users to add to the team 

All your CSV file needs here is the email addresses associated with each user’s Teams account and their selected role (Owner or Member). 

If you’re adding users to different teams, you can also choose to add the team name to distinguish the different teams they need to be added to.  

Adding CSV file to PowerShell

Step 4: Import Users from CSV to Microsoft Teams using PowerShell 

Run the following script to complete adding these users to your selected team: 

# Get users from the CSV 

$TeamUsers = Import-Csv -Path "C:\Temp\TeamsUsers.csv" 

# Iterate through each user from the CSV and add to Teams 

$TeamUsers | ForEach-Object { 

       Add-TeamUser -GroupId $TeamID -User $_.Email -Role $_.Role 

       Write-host "Added User:"$_.Email -f Green 


Why automate Microsoft Teams team memberships 

Realistically, you’re not going to be adding a single user to a single team when a new employee starts. That would mean they can’t collaborate on projects or team-based activities. 

They’d be restricted to chats and the one channel you add them too and have to route around and find teams by chance. 

Other than being a bad experience, this often leads to users joining the wrong teams or too many teams.  

Feeling like they’re running the risk of missing out on something that sounds like they should be involved, they join every team related to marketing just because they are part of the marketing team. 

In reality, they work in event marketing and only need to join the relevant channels to the events they are tasked with managing.  

As a result, their channel list is overloaded and immediately becomes noise pollution in what should be a productive Teams experience. 

When you automate team memberships, you’ll also benefit as an admin. 

Automating team memberships means you’ll:

  • Save time: reduce the hours per month spent on manually adding users to teams. 
  • Save money: reduce the associated cost with the hours spent adding users manually. 
  • Remove risk of error: removing the manual typing, copy and pasting, and script creation means you significantly reduce the chance of human error – leading to time and money savings as you don’t need to redo work. 

How to automate your Microsoft Teams team memberships 

Using Orto, you can use team groups to group common teams together so you can easily add users. 

For example, if the senior HR team all has access to the same 10 teams, it makes sense to group these together as an HR Teams group.  

This way, you won’t have to go into each team and add users one-by-one or get tripped up running multiple PowerShell scripts every time a team needs new users adding. 

Before you start, there are some pre-requisites: 

  • Must have signed up to Orto and connected your Teams tenant 
  • Must have the auto-provisioning license assigned 
  • Health check must be reporting a healthy status 
  • Must have at least one Microsoft Teams team created in your Microsoft 365 tenant 

When you’ve done this, you must sync your Teams tenant with Orto. 

Do this by clicking the Teams groups menu then hitting Sync teams

Syncing teams in Microsoft Teams to start automating team membership assignment

Your tenant will start syncing and the button will reappear when complete. 

Note: The sync of teams will only collect the Teams enabled groups found in your tenant. It will not sync the membership of these teams at present. To include newly created teams, please resync manually. In future, we plan to schedule this sync daily. 

When synced, you can create your Teams group. 

Click the New Teams group button, add a name and description. 

Then use the Builder select all the teams you wish to become part of this Teams group. 

Select which teams you need a user to be assigned in Microsoft Teams

Click Save. You’ve just built your first Teams group! 

Next up, we just need to add assign the Teams group to a user and they will have access to all the teams we previously selected. 

You can do this in one of two ways using Orto: 

  1. Manually 
  2. Using auto-provisioning 

To do this manually, simply find the user in Orto, choose the Team groups tab and select the team groups the user should be added to. 

This user will have all the teams in that group assigned to them. 

The second option is to let auto-provisioning remove that step when setting up your new user(s) for the first time. 

Instead of manually adding users to team membership groups (like in the above process), you can create user persona templates for every time of user. 

Say a new employee starts and they are in the HR team. They have also joined your business as a senior member of the team and need different access to a junior HR Manager. And they will be based in the New York office. 

With this role criteria, we can pre-populate a Senior HR user persona. 

Create a user persona to automate team membership assignment in Microsoft Teams

As part of that persona, you can include all team memberships associated with a senior HR function. This might be standard teams like #CompanyUpdates and #WaterCooler but it might also be #HRManagement and #HRPrivate. 

Whatever the teams, group these together, associate them with your user persona, and when you add your new senior HR hire, they will automatically get access to all these teams when you configure their Entra ID and denote they’re senior HR. 

How does this magic happen? 

It’s Orto pulling the strings (and the data). Using the persona template, Orto recognizes a new user Entra ID has been created, matches the user type (senior HR in our example), and pulls all the policy, team membership, and phone number information together to automatically provision your user. 

So, your new senior HR team member in the New York office will get a local phone number, the appropriate policy assignment, and access to all the teams they need. 

All you need to do is add the Entra ID and Orto will look after the rest. 

So, that’s team membership. But Orto also looks after: 

  • Policy assignment  
  • License assignment  
  • Number management  
  • Call queue assignment  
  • Moves, adds, changes, and deletions  

See what’s possible in the video below: 

Automating your Teams provisioning tasks can save you $500,000 by removing the manual inefficiencies associated with manual administration. 

Be it human error, lack of information on support tickets, or out-of-date inherited scripts, we leave the door open to manual failure when we rely on humans to carry out tasks that can be automated. 

Using Orto, you get peace of mind that every user has access to the teams, policies, and numbers they need to get on with their job from day one. 

There’s also the added benefit of them leaving you alone as there’s no need to call support or raise a ticket. 

We can all agree that sounds like a better world to be in! 

Ready to start automating team assignments in Microsoft Teams? 

👉 Book your Orto free trial here. 

Some Other Articles You Might Like

Intermittent Microsoft Teams calling issues reported globally. This issue appears to be affecting all Microsoft customers worldwide. Microsoft are currently investigating the issue. All Callroute systems are fully operational. More information will be provided as soon as possible.