Link to home
Start Free TrialLog in
Avatar of amku03
amku03

asked on

Create Dynamic Distribution List containing users enabled for Office Communicator

we have Exchange 2007 SP1,  Windows 2003 Active directory and recently deployed Office Communicator 2007 R2.

at this time the OCS deployment is in a pilot phase, we have enabled certain users in IT and there is a specific need to create a Dynamic DL in exchange which contains users enabled for OCS.

How can i create one, please suggest.

Cheers!
Avatar of endital1097
endital1097
Flag of United States of America image

For 2010:
New-DynamicDistributionGroup -Name TestDDG -RecipientFilter { ((EmailAddresses -like 'SIP:*') -or (((((((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'))))) }

for 2007:
New-DynamicDistributionGroup -Name TestDDG -RecipientFilter { ((EmailAddresses -like 'SIP:*') -or (((((((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_{*')) ))) }
Avatar of amku03
amku03

ASKER

Thanks...trying this right now
use my other script to verify members

$group = Get-DynamicDistributionGroup "Contoso Users"
Get-Recipient -RecipientPreviewFilter $group.RecipientFilter -OrganizationalUnit $group.RecipientContainer | ft displayName,primarysmtpaddress
remove the -organizationalunit switch for 2007
Avatar of amku03

ASKER

i am assuming thsi will take time to get created...
the command doesn't seems to coming out of execution...
no it should run quickly
did it go to a line with
<<
Avatar of amku03

ASKER

yes it did
>>
copy and paste the command in notepad
make sure it runs on a single line and try again
Avatar of amku03

ASKER

ok my bad...missed one }
its fine now
did you verify memebers
Avatar of amku03

ASKER

Seems to be a problem...
I am previewing the DL through EMC and its giving all users as members.
I am sure that we have only 30 or 40 users max with OCS.

Where did I go wrong
ASKER CERTIFIED SOLUTION
Avatar of endital1097
endital1097
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amku03

ASKER

This looks perfect!!
great news. sorry about the or mixup :)
Avatar of amku03

ASKER

now on the second part:
how can i user your script to verify the members in EMS?

I am pretty new to powershell and I am getting errors while running your second script
you must have 2007
update it to two lines

$group = Get-DynamicDistributionGroup "Contoso Users"
Get-Recipient -RecipientPreviewFilter $group.RecipientFilter | ft displayName,primarysmtpaddress
Avatar of amku03

ASKER

Ok...need to work on this...but for now I am good.

Could you also take a look on my other open question:
https://www.experts-exchange.com/questions/26469054/Autodiscover-Service-DNS-Entry.html


Thanks for your help
Avatar of amku03

ASKER

Excellent!!!