Solved

Modify existing exchange 2007 dynamic distribution group

Posted on 2010-09-02
27
1,135 Views
Last Modified: 2012-05-10
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
Comment
Question by:dougdog
  • 13
  • 11
  • 3
27 Comments
 
LVL 5

Expert Comment

by:rov17
ID: 33587338
0
 

Author Comment

by:dougdog
ID: 33587512
need comands
0
 
LVL 5

Expert Comment

by:rov17
ID: 33587708
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:dougdog
ID: 33588446
it is telling me the object cant be found

from the exchange shell im entering

Add-DistributionGroupMember -Identity distributiongroupname -Member 'joe smit'
0
 
LVL 5

Expert Comment

by:rov17
ID: 33592787
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
 
LVL 32

Expert Comment

by:endital1097
ID: 33606500
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
 
LVL 32

Expert Comment

by:endital1097
ID: 33606527
if your users are not in the default users container you'll also want to add the
-RecipientContainer contoso.com/OUname
0
 

Author Comment

by:dougdog
ID: 33612052
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
 
LVL 32

Expert Comment

by:endital1097
ID: 33612340
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
 

Author Comment

by:dougdog
ID: 33616066
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
 
LVL 32

Expert Comment

by:endital1097
ID: 33616723
sorry, i ran it against 2010 which includes that
remove
-and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan'))
0
 
LVL 32

Accepted Solution

by:
endital1097 earned 500 total points
ID: 33617220
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
 

Author Comment

by:dougdog
ID: 33617388
can i apply this to the whole domain
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33617412
yes, 2007 does not have the recipientcontainer filter
0
 

Author Comment

by:dougdog
ID: 33617461
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
 
LVL 32

Assisted Solution

by:endital1097
endital1097 earned 500 total points
ID: 33617492
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
 

Author Comment

by:dougdog
ID: 33617617
thats the job now
will this look through the whole domian or do i need to add the recipient filter
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33617633
that will do the whole domain by default
0
 

Author Comment

by:dougdog
ID: 33617788
perfect
0
 

Author Comment

by:dougdog
ID: 33617839
can the existing group be modified or do i have to create a new one
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33617919
i have never tried to update, but the cmdlet set-dynamicdistributiongroup does allow for modifying this filter
0
 

Author Comment

by:dougdog
ID: 33618158
no prob i will just delete it and re create
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33626090
did this work for you? i was going to test updating an existing ddg today
0
 

Author Comment

by:dougdog
ID: 33628220
i just deleted the old one and recreated it
many thanks
0
 

Author Comment

by:dougdog
ID: 33644819
Actually when i send a test email this does not work
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33645128
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
 

Author Comment

by:dougdog
ID: 33645272
sorry just being stupid i needed to add the correct recipient filter

thanks for coming back to me
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question