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
Solved

Distribution List Membership of Mail Contacts

Posted on 2014-11-24
1
92 Views
Last Modified: 2014-12-30
Experts,

I'm using Exchange 2010 with Outlook 2010.

I use distribution lists with mail contacts to send to our membership.  I'm looking to clean up my Exchange mail contacts and I know that if they aren't attached to any DL's after I've created this year's lists, that they can be purged.  
I'm trying to create a list filtering on addresslistmembership, assuming if the value is zero, I'll get my results.  I'll then export it to csv, check it then run a purge based on an edited CSV.
So here's what I tried:
Get-contact | where {$.addresslistmembership –eq 0}
I get nothing with this...

However, if I reverse it:
Get-contact | where {$.addresslistmembership –ne 0}

I get a list of contacts that are attached to DL's.  

Not sure what I'm doing wrong or how best to approach this and I'm looking for suggestions.

Thanks!
0
Comment
Question by:algren13
1 Comment
 
LVL 16

Accepted Solution

by:
Rajitha Chimmani earned 500 total points
ID: 40463364
You are looking for DL membership using GAL membership property and the syntax is not correct. The best or the easiest I could find is to get all mail contacts with their Name and Memberof property into a csv file and filter  the contacts with null value.

Import-Module ActiveDirectory
Get-MailContact | %{Get-ADObject $_.GUID -Properties Memberof | Select Name,Memberof >> contacts.csv}
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
how to add IIS SMTP to handle application/Scanner relays into office 365.

808 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