Solved

Query Excahnge Dynamic Dist list and export to a test

Posted on 2011-03-03
4
794 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
  • 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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Distribution Group 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 Recipients >>…
In this video we show how to create a mailbox database 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 >> Data…

828 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