Share via

Permissions

Rising Flight 5,176 Reputation points
Apr 12, 2025, 10:25 PM

I have two questions:

  1. I have a distribution lists (DL) in Exchange Online and Exchange onprem, and I would like to assign the following permissions using PowerShell. Could you please guide me with the correct PowerShell syntax?

Send As

Send on Behalf

2.The following syntax works for regular distribution lists. For dynamic distribution lists, if I replace Set-DistributionGroup with Set-DynamicDistributionGroup, will it still work?

Set-DistributionGroup "DL1" -AcceptMessagesOnlyFrom @{Add="user1"}

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,929 questions
{count} votes

Accepted answer
  1. Hien-L 4,580 Reputation points Microsoft External Staff Moderator
    Apr 23, 2025, 11:48 AM

    Hi Rising Flight,

    Welcome to our forum!

    1.Both Exchange Online and On-Premises use Set-DistributionGroup and Set-DynamicDistributionGroup with the -GrantSendOnBehalfTo parameter. For Send As, the process is different. Send As is a permission managed via AD permissions, so the cmdlets involved are Add-RecipientPermission. The syntax would be using Add-RecipientPermission

    Send on Behalf

    Use -GrantSendOnBehalfTo with Set-DistributionGroup (for static DLs) or Set-DynamicDistributionGroup (for dynamic DLs).

     

    Exchange Online/On-Premises Syntax:

    
    # Static Distribution List
    
    Set-DistributionGroup "DL1" -GrantSendOnBehalfTo @{Add="user1"}
    
    # Dynamic Distribution List
    
    Set-DynamicDistributionGroup "DynamicDL1" -GrantSendOnBehalfTo @{Add="user1"}
    
     
    
    

    Send As 

    Use Add-RecipientPermission to grant the SendAs right. This applies to both static and dynamic DLs.

     

    Exchange Online/On-Premises Syntax:

    
    # Static or Dynamic Distribution List
    
    Add-RecipientPermission -Identity "DL1" -Trustee "user1" -AccessRights SendAs
    
    

     

    2.Yes, replacing Set-DistributionGroup  with Set-DynamicDistributionGrou  works for parameters that are common to both cmdlets. For example:

     

    
     
    
    # Works for dynamic DLs
    
    Set-DynamicDistributionGroup "DynamicDL1" -AcceptMessagesOnlyFrom @{Add="user1"}
    
    

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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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