Forum Discussion
Is it possible to create Office 365 Groups with Azure AD PowerShell Module (2.0.0.98)?
- Apr 29, 2017
You have to use the New-AzureADMSGroup cmdlet to create a new Office 365 Group. This is a variation of New-AzureADGroup that uses the Microsoft Graph to create the group.
[PS] C:\> New-AzureADMSGroup -Description “A Group for Juan to play with” -DisplayName “Juan's Office 365 Group” -MailEnabled $true -SecurityEnabled $true -MailNickname “JuanGroup” -GroupTypes “Unified”
But I would always run New-UnifiedGroup to create an Office 365 Group...
You have to use the New-AzureADMSGroup cmdlet to create a new Office 365 Group. This is a variation of New-AzureADGroup that uses the Microsoft Graph to create the group.
[PS] C:\> New-AzureADMSGroup -Description “A Group for Juan to play with” -DisplayName “Juan's Office 365 Group” -MailEnabled $true -SecurityEnabled $true -MailNickname “JuanGroup” -GroupTypes “Unified”
But I would always run New-UnifiedGroup to create an Office 365 Group...
- Apr 29, 2017Thanks Tony, I was missing the -GroupTypes "Unified" :-)...why do you say to run always New-UnifiedGroup?
- TonyRedmondApr 29, 2017MVP
Because when you run New-UnifiedGroup, the mailbox is created immediately. When you run New-AzureADMSGroup, the group object is created in AzureAD and then synchronized with EXO, which then creates the group mailbox.
- Rob de JongMay 01, 2017Former Employee
I think it depends a bit on the script you are building. If you want to create a new unified group and then immetiately execute a cmdlet that executes on the mailbox of the new group your best bet is New-Unifiedgroup, for the reason Tony explained. Please note though that in my test environment such a script will still fail about 25% of the time, since the mailbox may not be created yet when I execute the next cmdlet.
If your script sets a dynamaic rule for group membership on the new Unified group, you should use the New-AzureADMSGroup cmdlet, since the delay between New-UnifiedGroup and the actual creation of the groups in AzureAD will likely make a subsequent Azure AD cmdlet call fail if executed immediately after the New-UnifiedGroup cmdlet.