Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Query Excahnge Dynamic Dist list and export to a test

Posted on 2011-03-03
4
Medium Priority
?
801 Views
Last Modified: 2012-05-11
I have Exchange 2010 SP1 and it appears that I need to run this to query a dyn dist list for members

$group = get-DynamicDistributionGroup -identity "AJ.All.Staff"
Get-Recipient -LdapRecipientPreviewFilter $group.RecipientFilter

The 2nd line needs -LdapRecipientPreviewFilter apparently rather than –RecipientPreviewFilter (which works with 2007)

But it will not work.  Please help me
0
Comment
Question by:stowyo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Akhater
ID: 35032115
$group = get-DynamicDistributionGroup -identity "AJ.All.Staff"
Get-Recipient -RecipientPreviewFilter $group.RecipientFilter

works just fine as it is
0
 
LVL 49

Accepted Solution

by:
Akhater earned 2000 total points
ID: 35032134
for a more accurate result you should use

Get-Recipient -RecipientPreviewFilter $group.RecipientFilter -OrganizationalUnit $Group.RecipientContainer
0
 
LVL 1

Author Comment

by:stowyo
ID: 35033042
I tried this and it did not work...
Get-Recipient -RecipientPreviewFilter $group.RecipientFilter -OrganizationalUnit "ou=BA, ou=Europe, dc=mycompany, dc=com" $Group.RecipientContainer

I cannot figure out the way to put in the OU.  

Also, will this show the hidden mailboxes?  I do not want to show those..
0
 
LVL 1

Author Comment

by:stowyo
ID: 35033208
Sorry, I just figured it out.  The OU had an incorrect domain name which threw me off for a while, but I found out that I do not need to specify an OU.  Here is the complete command for future geeks looking to figure out how to do this...

$group = get-DynamicDistributionGroup -identity "AJ.All.Staff"

Get-Recipient -RecipientPreviewFilter $group.RecipientFilter -OrganizationalUnit $Group.RecipientContainer

Those above commands should be on two lines.  The second line may wrap on your screen here at experts-exchange but needs to be entered as one command...
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
In this video we show how to create an email address policy 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…
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…

618 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