Solved

powershell script to find AD contacts without an exchange contact

Posted on 2012-03-21
3
1,602 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

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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…

803 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