Question : Editing an Exchange Dynamic Distribution Group via EMS

Ok...I thought I had this taken care of but apparently I'm doing something wrong and can't find it...

Brief story on what I'm trying to do:
I am creating a dynamic distribution list that will mail out to all faculty and staff mailboxes (on Exchange & Lotus Notes). I am attempting to restrict the recipients, descriptions, containers, etc. that this group mails out to. I have included my code below...

Here's the problem, when I generate a .txt file with a list of the recipients it only contains the users with a description as "UserMailbox". I'm attempting to put in the filter to include those with a description of "MailContact" as well. I'm also filtering to two different containers (Accounts & Domino Contacts). If you could take a look at my string here and see if I'm missing something somewhere I would greatly appreciate it. This is my first attempt at a powershell edit of a dynamic distribution list...so it may be something obvious.
1:
set-DynamicDistributionGroup "AllFacStaff" -recipientfilter "((((RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact') -and (RecipientContainer -eq 'Accounts') -or (RecipientContainer -eq 'Domino Contacts'))) -and -not(Description -like 'Domino Group')) -and -not(name -like 'Patriots Test*') -and -not(Name -like 'itsupport')"

Answer : Editing an Exchange Dynamic Distribution Group via EMS


Hmm I think you might want to change the grouping of those expressions, it's not particularly good as it stands:

Set-DynamicDistributionGroup "AllFacStaff" -RecipientFilter { (RecipientType -eq 'UserMailbox' -Or RecipientType -eq 'MailContact') -And (RecipientContainer -eq 'Accounts' -Or RecipientContainer -eq 'Domino Contacts') -and -not (Description -like 'Domino Group') -and -not (name -like 'Patriots Test*') -and -not (Name -like 'itsupport') }

I believe your RecipientContainer needs to be in the form:

domain.com/base OU/Domino Contacts

That is, it needs to be the full path if it's to work at all, although I haven't heard anything good about ReceipientContainer and couldn't tell you if it would work even then.

Still, give it a shot and let us know?

Cheers,

Chris
Random Solutions  
 
programming4us programming4us