How can i create a exchange 2007 dynamic distribution group based on a company name and 1 user

How can i create a dynamic distribution group that will pull all users based on the company name in active directory and add 1 extra user to that group sa based on username or alias
Who is Participating?
endital1097Connect With a Mentor Commented:
here is the 2007 version
New-DynamicDistributionGroup -Name TestDDG -RecipientFilter { ((Alias -eq 'jim') -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_{*')) ))) }

Open in new window

Mkris9Commented: should help in creating the Dist Group based on company. didn't really understand about the extra user. can you explain a bit more pls ?
Try with this command :

New-DynamicDistributionGroup -Name yourDLName -OrganizationalUnit -RecipientFilter { ((RecipientType -eq 'UserMailbox')  and (Company -eq 'yourcompanyname')  or (customAttribute1 -eq 'yourvalue')) }
For that one use assumption here is to add customAttribute1 value to 'yourvalue'  .
you can then validate the dynamic distribution group

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

Open in new window

All Courses

From novice to tech pro — start learning today.