Exchange 2010 assign rights to send to restricted distribution groups

This post is also available in: Polish

In Microsoft Exchange we can set distribution group as restricted.
Then this distribution group will only accept messages from specified users.

We can set this settings in distribution group properties in tab Mail Flow SettingsMessage Delivery Restrictions.

In section Accept messages from select Only senders in the following list and add all users who can send messages to this group.

Messages from other users will be rejected

DistributionGroupRestricted

 

If we have many of distribution groups with restrictions and we need to assign send rights to this groups then we have a problem.

To find all distribution groups with delivery restrictions we can use Exchange Management Shell and below command:

Get-DistributionGroup -ResultSize unlimited | ?{($_.AcceptMessagesOnlyFrom).count -gt 0}

 

As a result we will get list of all distribution groups in our environment which has set AcceptMessagesOnlyfrom.

Another problem is to add user to all of those groups.

Good solution is to create Security Group in Active Directory, and add this group to all restricted distribution groups to allow send messages to those restricted groups for all users from security group.

Then if we need to add rights to send to all restricted groups then we can just add this user to security group.

But if you haven’t such security group, then you can again use Powershell to add specified user rights to send to restricted distribution groups.

Use below example, and write an email address of users to add the rights to send:

$DN = (get-Mailbox j.smith@domain.com).DistinguishedName 

If ($DN -ne $null) 
{ 
 $Groups = @(Get-DistributionGroup -ResultSize Unlimited | ?{@($_.AcceptMessagesOnlyFrom).count -gt 0 -and $_.AcceptMessagesOnlyFrom -NotContains $DN}) 

 Foreach ($Group in $Groups) 
 { 
  $CurrentUsers = (Get-DistributionGroup $Group.Name).AcceptMessagesOnlyFrom 
  $CurrentUsers.Add($DN) 
  Write-Host "Added $DN to $Group.Name" -ForegroundColor Green 
  Set-DistributionGroup $Group.Name -AcceptMessagesOnlyFrom $CurrentUsers 
 } 
}

 

Now user j.smith@domain.com is added to all restricted distribution group, and is allowed to send an email to them.

 

Print Friendly
Tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>