Solved

powershell script to find AD contacts without an exchange contact

Posted on 2012-03-21
3
1,578 Views
Last Modified: 2012-03-22
Hi I'm looking for a powershell script that will return a list of AD contacts that do not have a exchange contact any help would be great

thanks
0
Comment
Question by:davidm27
3 Comments
 
LVL 12

Expert Comment

by:prashanthd
ID: 37751193
Exchange version?
0
 
LVL 70

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 37751391
You could do with something to execute this filter:

(&(objectClass=contact)(!(targetAddress=*)))

That gives you all contacts which have not been Mail-Enabled in any version of Exchange from 2000 up.

Options for executing that include:
# Quest - http://www.quest.com/powershell/activeroles-server.aspx
Get-QADObject -LdapFilter "(&(objectClass=contact)(!(targetAddress=*)))"

# MS AD CmdLets
Get-ADObject -LDAPFilter "(&(objectClass=contact)(!(targetAddress=*)))"

# Native .NET
([ADSISearcher]"(&(objectClass=contact)(!(targetAddress=*)))").FindAll()

Open in new window

And if you're running Exchange 2007 or 2010 you can also do this:
Get-Contact -RecipientTypeDetails Contact

Open in new window

Of course, you can use the LDAP filter in any other program able to search, such as AD Users and Computers, or ADFind, or, well the list is pretty much endless.

HTH

Chris
0
 

Author Closing Comment

by:davidm27
ID: 37751599
just what i needed thanks
0

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
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 an email address policy 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 Mail Flow…
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…

744 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

14 Experts available now in Live!

Get 1:1 Help Now