Share via

Syntax help

Glenn Maxwell 13,761 Reputation points
2023-06-19T00:36:58.0533333+00:00

Hi All

Can anyone help me with the syntax in creating online DL, office 365 unified group from exchange online PowerShell.

Is the Below Syntax correct for DL creation, how can i add owners in the Syntax. lets say owners are ******@contoso.com & ******@contoso.com

New-DistributionGroup -Name "DL-Test" -Alias ******@contoso.com -DisplayName "DL-Test" -PrimarySmtpAddress "******@contoso.com"

How can i create unified group with display name: UG-Test, group email address as ******@contoso.com, owners ******@contoso.com & ******@contoso.com

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.

Exchange | Hybrid management
Exchange | Hybrid management

The administration of a hybrid deployment that connects on-premises Exchange Server with Exchange Online, enabling seamless integration and centralized control.

0 comments No comments

Answer accepted by question author

Dezhi Li-MSFT 800 Reputation points
2023-06-19T06:54:13.13+00:00

Hi @Glenn Maxwell,

You can try to use the following command to create DistributionGroup in exchange online then set owner as ******@contoso.com & ******@contoso.com

New-DistributionGroup -Name “DL-Test” -Alias DL-Test -DisplayName “DL-Test” -PrimarySmtpAddress “******@contoso.com” -ManagedBy ******@contoso.com,******@contoso.com

You can try to use the following command to create a UnifiedGroup in exchange online and then set the owner as ******@contoso.com & ******@contoso.com

New-UnifiedGroup -DisplayName "UG-Test" -Alias UG-Test -PrimarySmtpAddress "******@contoso.com" -Members ******@contoso.com,******@contoso.com -ManagedBy ******@contoso.com,user2@contoso .com

For more details, please check the link below.

https://learn.microsoft.com/en-us/powershell/module/exchange/new-distributiongroup?view=exchange-ps

https://learn.microsoft.com/en-us/powershell/module/exchange/new-unifiedgroup?view=exchange-ps

Best Regards,

Dezhi


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.