Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

powershell script to find AD contacts without an exchange contact

Posted on 2012-03-21
3
Medium Priority
?
1,668 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
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
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

916 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