I've previously showed how to update email address on an Office 365-group with Powershell. In this post I'll demonstrate how to create the group and set a custom email-adress.
First out, as always, we need to connect our Powershell session to Office 365 (or more specifically Exchange Online). See my previous post (Some neat Powershell-snippets for connecting to Office 365 and Exchange Online) on how to achieve that.
Now all we have to do is to run the following cmdlet:
New-UnifiedGroup. The most important parameters are:
DisplayName – The DisplayName of the new group
Alias – The EmailAlias of the group. If it's not provided the group will get a generated alias from the DisplayName
AccessType – Privacy type of the group (Public or Private)
AutoSubscribeNewMembers – Add this switch to auto-subscribe new members to the group
PrimarySmtpAddress – If you want the group to get a custom email address
So for my user-case the end result looked like this:
New-UnifiedGroup -DisplayName "A nice name" -Alias a_nice_name -PrimarySmtpAddress email@example.com -AutoSubscribeNewMembers