DynamicDistributionGroup for all users in a particular storage group

Sorry Evan, but just to correct you a little bit. ;-) but you need in get-mailboxdatabase and –organizationalUnit in New-DynamicDistributionGroup

To create a DDL for each DB in an SG

get-mailboxdatabase -StorageGroup | % { New-DynamicDistributionGroup “DDG-$($_.Name)” –organizationalUnit  / -RecipientFilter “Database -eq ‘$($_.Identity.DistinguishedName)’” }

So now the BIG issue is how to the a list of the members! 

I blogged this ages ago: http://blogs.flaphead.dns2go.com/archive/2007/05/10/exchange-2007-dynamic-distributions-groups.aspx

But you could do this and create a DDL for each DB on the server,as you would (in theory) have a 1:1 ratio for SG:DB

#Create DDL for a Server
$Server = “SUKMSDMBX03″
$DDLalias = “DDL-$Server”
$DDLName = “zz $server”
$DDLOU = “exchorg.local/MyOU/pf”
New-DynamicDistributionGroup -alias “$DDLalias” -name “$DDLName” -recipientfilter {ServerName -eq $Server} –organizationalUnit “$DDLou”

$ddl = Get-DynamicDistributionGroup “$DDLName”
get-recipient -filter $ddl.recipientfilter

#Create DDL for Exchange SG on that Server
$MBX = Get-MailboxDatabase -Server $server

foreach ($db in $mbx)
{
    $dbPath = $db.DistinguishedName.ToString()
    $dbDDLName = $db.name
    $dbDDLName = “BW MS ” + $dbDDLName
    New-DynamicDistributionGroup $dbDDLName  –organizationalUnit
“$DDLou” -RecipientFilter {database -eq $dbpath}
    
}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: