09-01-2020 09:13 AM
09-01-2020 09:13 AM
I'm using PowerShell to create classes in Teams and it works fine with the Microsoft Teams module version 0.9.6, which allow me to select the accurate template (EDU_Class). It's the only version that worked for me since the latest version doesn't allow you to define a template.
So, to give you some context, I have to create multiple classes with multiple domains name, and this version doesn't allow you to specify the domain that you want, it uses the "Alias" parameter, example :
New-Team -displayname "MyClassName" -Alias "class2020" -Template EDU_Class
this command will create the class MyClassName with the following mail address : class2020@domainByDefault.fr
The domain name is defined by default in the Microsoft tenant so you can only create classes for 1 domain at a time but this is not the main problem, the main problem is that I have multiple classes who are supposed to be called "class2020" but with different domain name, for example :
So when I try to create a team who has the same alias than another one (but with a different domain) it makes an error and it doesn't create the classes I want so I have to put something like : class20B to make it work and then I can change it manually through the Microsoft Administration platform, which is kind of annoying.
Is there an other way to do this ? will there be an update allowing us to use the -Template parameter in a future version of the Teams module ?
09-01-2020 01:12 PM - edited 09-01-2020 01:13 PM
Hi @Gab7 ,
Off the top of my head I am wondering if the way to go would be to facilitate the desired domain specification by way of creating an M365 Group, along the lines of https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_domains/create-an-office-3...
And then once that is present and correct just Teams enable that Group.
I am not sure it will solve your issue but worth knowing about anyway, I would also take a look at:
I believe from an end user perspective, if they were creating Teams you would handle this by way of an Exchange Address Policy, so in theory, albeit excessive. You could look to have different accounts, with different EAPs applied based on which domain you want to create the Team in.
09-02-2020 12:32 AM
Thanks for your help, the thing is that I absolutely need the classroom template to create proper teams, but your first post gave me a great idea, it's a bit complex just to create a class but it might work.
I'm going to try to create the teams like I usually do but with a slight difference like I said :
"so I have to put something like : class20B to make it work"
and then i'll use the :
Set-UnifiedGroup -Identity "class20B@domain1.fr" -PrimarySmtpAddress "email@example.com"
to change the address so I won't have to manually change the adresses in the administration web page.
I wonder if it will make an error, I'll keep this post updated.
09-02-2020 12:45 AM
09-02-2020 12:48 AM
09-07-2020 06:26 AM
It worked !!
I now create my classes using the teams module but with a slight difference (like I said before) and when all teams are created, I use the given GroupID and the following command (with the exchange online module this time) :
Set-UnifiedGroup -Identity $GroupID -PrimarySmtpAddress $MailAfter
And it changes the primary address :)
thx for your help