How to Create a Office 365 Group using PowerShell?
Requirement: Create New Office 365 Group using PowerShell
How to Create an Office 365 Group in the Admin Center?
Microsoft 365 Groups is a service that enables teams to work together by establishing a single identity and a single set of permissions across Microsoft 365 apps including Outlook, SharePoint, OneNote, etc. As an admin, you can create office 365 groups through Microsoft 365 admin center.
How to Create Office 365 Group using PowerShell?
Creating an Office 365 group through PowerShell allows you to have more control over the Group properties. To create an Office 365 Group you need to first establish a remote session to Exchange Online and then use New-UnifiedGroup cmdlet to create an Office 365 Group with PowerShell.
Open Windows PowerShell and run the following script:
Parameters used in this cmdlets are self-explanatory. Basically, they define properties of the group:
Create New Office 365 Group using Azure AD PowerShell Module:
You can create a new group in Office 365 using the Azure Active Directory module as well. Here is an example:
How to Create an Office 365 Group in the Admin Center?
Microsoft 365 Groups is a service that enables teams to work together by establishing a single identity and a single set of permissions across Microsoft 365 apps including Outlook, SharePoint, OneNote, etc. As an admin, you can create office 365 groups through Microsoft 365 admin center.
- Log in to the Microsoft 365 Admin Center site: https://admin.microsoft.com
- Expand Groups and Click on Groups in the left navigation.
- Click on "Add a Group" >> Select "Office 365" under Type.
- Provide a name for the group and unique email address for the group. Specify the privacy type for the Office 365 Group.
- Click on "Select Owner" button and choose the owner to manage the group
- Click on "Add" to start creating the Office 365 group.
How to Create Office 365 Group using PowerShell?
Creating an Office 365 group through PowerShell allows you to have more control over the Group properties. To create an Office 365 Group you need to first establish a remote session to Exchange Online and then use New-UnifiedGroup cmdlet to create an Office 365 Group with PowerShell.
Open Windows PowerShell and run the following script:
#Get Credentials to connect $Credential = Get-Credential #Create the session $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential $Credential -Authentication Basic -AllowRedirection #Import the session Import-PSSession $Session #Create New Office 365 Group New-UnifiedGroup -DisplayName "Consumers Group" -Alias "0365Group-consumers" ` -EmailAddresses "[email protected]" -AccessType Private #Remove the session Remove-PSSession $SessionThis creates a new private group called "Consumers Group" with an email address of "[email protected]"
Parameters used in this cmdlets are self-explanatory. Basically, they define properties of the group:
- DisplayName: The Display name of the group, is the minimum parameter to create a group.
- Alias: Exchange alias for the group. If you don't supply the value for this parameter, it will be generated.
- EmailAddresses: The e-mail address of the Group.
- AccessType: Public or Private.
Create New Office 365 Group using Azure AD PowerShell Module:
You can create a new group in Office 365 using the Azure Active Directory module as well. Here is an example:
#Connect to Azure AD Connect-AzureAD #Create new Office 365 group New-AzureADMSGroup -DisplayName "Accounts Group" -MailNickname "Accounts" -GroupTypes "Unified" -Description "Office 365 Group for Accounts Departmnet" -MailEnabled $True -SecurityEnabled $TrueWhen the "Connect-AzureAD" cmdlet prompts for credentials, Enter your Office 365 Admin account!
No comments:
Please Login and comment to get your questions answered!