Creating a dynamic distribution group in Exchange 2010 using the EX shell

Hi,
I need help with the syntax of creating a new dynamic distro group using the Exchange shell.

I have users who are in specific offices, so I use the "Office" field to designate their office.
I need to create various distro groups based on their office.

Using this: I get all users in a specific office:
Get-Mailbox -Filter {Office -eq 'New York'}

Now, what I want to do is create a distro group called "NY" for example that contains all users in  the Office of 'New York".
I have tried this in several different ways but it's not working:
New-DynamicDistributionGroup -Name "NY"  -Filter {Office -eq 'New York'}

Can anyone tell me how to do this?
Thanks!
Mike
LVL 1
nachtmskAsked:
Who is Participating?
 
FarWestCommented:
did you put each office on seperate OU, if so you just specifiy the OU
example

New-DynamicDistributionGroup -IncludedRecipients MailboxUsers -Name "NY DDG" -OrganizationalUnit NYOffice

If not I think you can use -RecipientFilter  parameter not -filter
0
 
Shreedhar EtteCommented:
0
 
nachtmskAuthor Commented:
Thanks. I was already looking at the article. I was asking for more specific help.
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.

All Courses

From novice to tech pro — start learning today.