Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

powershell script to find AD contacts without an exchange contact

Posted on 2012-03-21
3
Medium Priority
?
1,657 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
[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
3 Comments
 
LVL 12

Expert Comment

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

Accepted Solution

by:
Chris Dent earned 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
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
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

670 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