Create mail enabled security group office 365
Here are the steps to create a mail-enabled security group in Office 365:
Prerequisites:
- You have an Office 365 tenant with the necessary permissions to create a security group.
- You have the Azure Active Directory (Azure AD) module for PowerShell installed on your machine.
Step 1: Create a security group
Open PowerShell and run the following command to create a new security group:
New-AzureADGroup -DisplayName "Mail Enabled Security Group" -MailEnabled $true -MailNickname "mesg" -SecurityEnabled $true
This command creates a new security group with the display name "Mail Enabled Security Group", mail-enabled, and security-enabled.
Step 2: Add members to the security group
You can add members to the security group using the following command:
Add-AzureADGroupMember -ObjectId <groupObjectId> -RefObjectId <userObjectId>
Replace <groupObjectId>
with the object ID of the security group you created in Step 1, and <userObjectId>
with the object ID of the user you want to add to the group.
For example:
Add-AzureADGroupMember -ObjectId 12345678-1234-1234-1234-123456789012 -RefObjectId 98765432-1234-1234-1234-123456789012
Step 3: Verify the security group is mail-enabled
Run the following command to verify that the security group is mail-enabled:
Get-AzureADGroup -ObjectId <groupObjectId> | Select-Object -ExpandProperty MailEnabled
This command should return True
if the security group is mail-enabled.
Step 4: Configure the security group's email address
You can configure the security group's email address using the following command:
Set-AzureADGroup -ObjectId <groupObjectId> -Email <emailAddress>
Replace <groupObjectId>
with the object ID of the security group, and <emailAddress>
with the email address you want to assign to the group.
For example:
Set-AzureADGroup -ObjectId 12345678-1234-1234-1234-123456789012 -Email "[email protected]"
Step 5: Verify the security group's email address
Run the following command to verify that the security group's email address has been updated:
Get-AzureADGroup -ObjectId <groupObjectId> | Select-Object -ExpandProperty Email
This command should return the email address you configured in Step 4.
That's it! Your mail-enabled security group is now created and configured in Office 365.