• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1146
  • Last Modified:

Modify existing exchange 2007 dynamic distribution group

How can i modify an existing exchange 2007 dynamic distribution group to include a specific user
I have a group which i want to add a user to
0
dougdog
Asked:
dougdog
  • 13
  • 11
  • 3
2 Solutions
 
dougdogAuthor Commented:
need comands
0
Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

 
dougdogAuthor Commented:
it is telling me the object cant be found

from the exchange shell im entering

Add-DistributionGroupMember -Identity distributiongroupname -Member 'joe smit'
0
 
rov17Commented:
Sorry Thursday night, the command is for a normal distribution group not a dynamic one.

The only way is to create a group with those new users in it in the OU and then change the DDG to include groups along with Mailbox's, and the group must be mail-enabled group as shown in the first link

Not sure what are the commands would be in this case.
0
 
endital1097Commented:
you need to to create the dynamic distribution group to include the mailbox
the following example should create a new DDG created with just a single user with the alias testmbx and everyone with company attribute equal to "Contoso"

New-DynamicDistributionGroup -Name TestDDG -RecipientFilter { ((Alias -eq 'Testmbx') -or (((((Company -eq 'Contoso') -and (((RecipientType -eq 'UserMailbox') -or (((RecipientType -eq 'MailUniversalDistributionGroup') -or (RecipientType -eq 'MailUniversalSecurityGroup') -or (RecipientType -eq 'MailNonUniversalGroup') -or (RecipientType -eq 'DynamicDistributionGroup'))))))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox'))))) }
0
 
endital1097Commented:
if your users are not in the default users container you'll also want to add the
-RecipientContainer contoso.com/OUname
0
 
dougdogAuthor Commented:
getting a lot of errors when i try to run this
New-DynamicDistributionGroup : Cannot bind parameter 'RecipientFilter' to the target. Exception setting "RecipientFilter": """ is not a valid operator
0
 
endital1097Commented:
make sure you have -RecipientFilter { (

you need to make sure you have the correct number of () within it
the filter can become complicated

i put my command in the code box below that I used in my lab
New-DynamicDistributionGroup -Name TestDDG -RecipientFilter { ((Alias -eq 'PIT1') -or (((((Company -eq 'Contoso') -and (((RecipientType -eq 'UserMailbox') -or (((RecipientType -eq 'MailUniversalDistributionGroup') -or (RecipientType -eq 'MailUniversalSecurityGroup') -or (RecipientType -eq 'MailNonUniversalGroup') -or (RecipientType -eq 'DynamicDistributionGroup'))))))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox'))))) }

Open in new window

0
 
dougdogAuthor Commented:
when i enter this i get the following

New-DynamicDistributionGroup : Cannot bind parameter 'RecipientFilter' to the target. Exception setting "RecipientFilter": "The value "MailboxPlan" could not be converted to type
Microsoft.Exchange.Data.Directory.Recipient.RecipientTypeDetails."
At line:1 char:60
+ New-DynamicDistributionGroup -Name TestDDG -RecipientFilter  <<<< { ((Alias -eq 'joesmith') -or (((((Company -eq 'contoso') -and (((RecipientType -eq 'UserMailbox') -
or (((RecipientType -eq 'MailUniversalDistributionGroup') -or (RecipientType -eq 'MailUniversalSecurityGroup') -or (RecipientType -eq 'MailNonUniversalGroup') -or (RecipientType -
eq 'DynamicDistributionGroup'))))))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not
(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox'))))) }

can i shorthen the code all i need is to do is create a dynamic distribution group that lists everyone that has the company name as contoso and 1 other individual
0
 
endital1097Commented:
sorry, i ran it against 2010 which includes that
remove
-and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan'))
0
 
endital1097Commented:
ok, i ran it again in 2007 land and got the same error and more
i adjusted it so it works in 2007

New-DynamicDistributionGroup -Name TestDDG -RecipientFilter { ((Alias -eq 'jd_martin') -or (((((Company -eq 'Contoso') -and (((Reci
pientType -eq 'UserMailbox') -or (((RecipientType -eq 'MailUniversalDistributionGroup') -or (RecipientType -eq 'MailUniversalSecurityGroup')
 -or (RecipientType -eq 'MailNonUniversalGroup') -or (RecipientType -eq 'DynamicDistributionGroup'))))))) -and (-not(Name -like 'SystemMailb
ox{*')) -and (-not(Name -like 'CAS_{*')) ))) }

Name                                                                  ManagedBy
----                                                                  ---------
TestDDG


$group = Get-DynamicDistributionGroup testddg
Get-Recipient -RecipientPreviewFilter $group.recipientfilter

Open in new window

0
 
dougdogAuthor Commented:
can i apply this to the whole domain
0
 
endital1097Commented:
yes, 2007 does not have the recipientcontainer filter
0
 
dougdogAuthor Commented:
when i enter the following
New-DynamicDistributionGroup -Name TestDDG -RecipientFilter { ((Alias -eq 'jack.smith') -or (((((Company -eq 'contoso ab') -and (((Reci
pientType -eq 'UserMailbox') -or (((RecipientType -eq 'MailUniversalDistributionGroup') -or (RecipientType -eq 'MailUniversalSecurityGroup')
 -or (RecipientType -eq 'MailNonUniversalGroup') -or (RecipientType -eq 'DynamicDistributionGroup'))))))) -and (-not(Name -like 'SystemMailb
ox{*')) -and (-not(Name -like 'CAS_{*')) ))) }

i dont get any errors now but i just get a >>
0
 
endital1097Commented:
paste it into notepad and disable word wrap
it should be a single line
once i made it a single line in notepad and pasted it into ems it worked
0
 
dougdogAuthor Commented:
thats the job now
will this look through the whole domian or do i need to add the recipient filter
0
 
endital1097Commented:
that will do the whole domain by default
0
 
dougdogAuthor Commented:
perfect
0
 
dougdogAuthor Commented:
can the existing group be modified or do i have to create a new one
0
 
endital1097Commented:
i have never tried to update, but the cmdlet set-dynamicdistributiongroup does allow for modifying this filter
0
 
dougdogAuthor Commented:
no prob i will just delete it and re create
0
 
endital1097Commented:
did this work for you? i was going to test updating an existing ddg today
0
 
dougdogAuthor Commented:
i just deleted the old one and recreated it
many thanks
0
 
dougdogAuthor Commented:
Actually when i send a test email this does not work
0
 
endital1097Commented:
you can run the following to verify members
$group = Get-DynamicDistributionGroup "Contoso Users"
Get-Recipient -RecipientPreviewFilter $group.RecipientFilter -OrganizationalUnit $group.RecipientContainer | ft displayName,primarysmtpaddress
0
 
dougdogAuthor Commented:
sorry just being stupid i needed to add the correct recipient filter

thanks for coming back to me
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

  • 13
  • 11
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now