Creating a Dynamic Distribution Group for all mailboxes on a Database

by Bharat Suneja

I posted about this in Adventures with OPATH: some annoyances if you’re used to LDAP, shortly after Exchange Server 2007 RTMed (Yes, it has really been that long… ). Here’s a quick recipe to create a Dynamic Distribution Group to include all mailboxes on a database.

$DB = (Get-MailboxDatabase “SERVER\Storage Group\Mailbox Database”).distinguishedName

New-DynamicDistributionGroup MyGroup -RecipientFilter {Database -eq $DB} -RecipientContainer “DC=MyDomain,DC=com” -OrganizationalUnit “OU=Distribution Groups,DC=MyDomain,DC=com” -RequireSenderAuthenticationEnabled $false

The first step gets the distinguishedName of the mailbox database in a variable called $DB.

Parameters:
OrganizationalUnit: Specifies the container/OU where the group will be created
RecipientContainer: Specifies container to pick up recipients from. If not specified, this gets set to the same value as the OrganizationalUnit parameter (the OU/Container where the group is created), and the filter may not return the expected recipients (or worse— may not return any recipients at all… )
RequireSenderAuthenticationEnabled: As discussed in ‘New Distribution Groups do not receive internet email by default‘, new groups do not receive internet email (that is, email from unauthenticated/anonymous senders)) by default. If you want the group to receive internet email, set this to $false.

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: