Solved

Distribution List Membership of Mail Contacts

Posted on 2014-11-24
1
86 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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this video we show how to create a User Mailbox 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 >> Mailb…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now