?
Solved

Distribution List Membership of Mail Contacts

Posted on 2014-11-24
1
Medium Priority
?
96 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
[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
1 Comment
 
LVL 16

Accepted Solution

by:
Rajitha Chimmani earned 2000 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

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

This article explains how to install and use the NTBackup utility that comes with Windows Server.
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

771 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