Searching using Custom Attributes in AD

Posted on 2011-09-22
Medium Priority
Last Modified: 2012-05-12

We are running Exchange 2007/ 2010 and AD 2003.

On our mailboxes and Distribution Groups, we use Custom Attributes to mark which Cost Center the object belongs to for billing purposes. For the sake of this example, the extension attribute 1 marks the Cost Center (Marketing, Corporate, etc).

I need to pull:

1. A list of all mailboxes belonging to Marketing

2. A list of all Distribution Lists belonging to Marketing

3. A list of all mailboxes with the name SMITH belonging to Marketing

4. A list of all DL's containing the word CORPORATE that belong to Marketing

Does anyone know how I can do this, using either the Exchange Management Shell or Quest Powershell?
Question by:neil4933
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
LVL 10

Expert Comment

ID: 36584101
LVL 15

Expert Comment

by:Ian Meredith
ID: 36584150
Here's your starting point....  being able to mass export mailboxes.


Once you have the right command you will be able to insert your filtering string to get the required result.

This should help with your distribution lists


Here is the breakdown on the command  Get-DistributionGroup


Here is the breakdown on the command New-MailboxExportRequest


Here are the Filtering options for the above commands - Filterable Properties for the -Filter Parameter in Exchange 2007 SP1 and SP2



Author Comment

ID: 36584186
Thanks both...really I'm looking for a way to search for custom attributes using Quest?

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

LVL 27

Expert Comment

ID: 36586135
neil4933, you can use the -LDAPFILTER switch with the quest tools.

get-qaduser -LDAPFILTER "(extensionattribute1=VALUE)"

get-qadgroup -LDAPFILTER "(extensionattribute1=VALUE)"


Author Comment

ID: 36590138
hi Ken

Ah, thanks...do you know how I'd use that to find the below then?
LVL 27

Accepted Solution

KenMcF earned 2000 total points
ID: 36590368
There are several ways you can get this information. Here is one example that should work and get what you want if I am reading you question right.

1. A list of all mailboxes belonging to Marketing

get-qaduser -ldpafilter "(extensionattribute1=Marketing)"

2. A list of all Distribution Lists belonging to Marketing

get-qadgroup -ldpafilter "(extensionattribute1=Marketing)"

3. A list of all mailboxes with the name SMITH belonging to Marketing

get-qaduser -ldpafilter "(&(sn=Smith)(extensionattribute1=Marketing))"

4. A list of all DL's containing the word CORPORATE that belong to Marketing

get-qadgroup -ldpafilter "(&(name=*corporate*)(extensionattribute1=Marketing))"

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. 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

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video discusses moving either the default database or any database to a new volume.
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

762 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