Solved

powershell script to find AD contacts without an exchange contact

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 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