Tag Archives: Teams

Office365 Teams: PowerShell automation of team membership

Office365 Academic (Education) does not support organization-wide teams. To get over this limitation, you can maintain the membership by a simple PowerShell script:

Get-MsolUser -All | Where-Object { $_.Licenses.ServiceStatus.ServicePlan.ServiceName -match "TEAMS"} | ForEach-Object { [pscustomobject]@{User = $PSItem.UserPrincipalName} } | Add-TeamUser -GroupId f29dbfc0-d118-4480-a6f7-22048a0809d0 -Role Member

In short:

  1. Take all Azure Active Directory users.
  2. Filter them to those having a Teams license assigned.
  3. Transform the data to input usable for Add-TeamUser cmdlet.
  4. Add the users to the team (you will get the GroupId by using Get-Team cmdlet)

You can run the script repeatedly, just the missing users will be added. You can modify the script easily and apply any additional conditions when adding the users to the group.

Might help:

Install-Module MicrosoftTeams
Install-Module MSOnline

Connect-MicrosoftTeams
Connect-MsolService

Get-Team

Office365/Exchange: Remote Server returned ‘532 5.3.2 STOREDRV.Deliver; Missing or bad mailbox Database property’

We have a mail-enabled public folder called Accounting which has an auto-generated e-mail address Accounting@havit.onmicrosoft.com. We use this folder to archive all the accounting-related communication (e.g. by Bcc/Cc-ing all e-mails to Accounting@havit.onmicrosoft.com).

A few days ago we started using Microsoft Teams where we created a new team called Accounting.

Now whenever we try to send anything to Accounting@havit.onmicrosoft.com we get an error:

Remote Server returned ‘532 5.3.2 STOREDRV.Deliver; Missing or bad mailbox Database property’

We renamed the Microsoft Teams team to Accounting, Administration (anything else than Accounting) and the issued disappeared immediately.

…there has to be some weird bug in Office365/Exchange which breaks the message routing when there is a team and public folder name collision.

UPDATE: After few days, the issue reappeared for some scenarios. We had to adjust e-mail addresses of the public-folder and the team manually to fit our needs.