Tuesday, April 24, 2007

Saved Queries Learning LDAP Custom Search for AD and Exchange

Most often Exchange administrators needs to search SMTP proxy address in Active Directory.

I have heard from many administrators not being able to make a lot of usage out of Custom search option in Active Directory.

I have decided to Blog about this with some of the tricks I have learned over the years and make my life as a little more efficient on a busy working day.

Search SMTP Proxy Address , Open up ADUC, go to Saved Queries

Right click New Folder and, in my case I used "Exchange Queries" Make a right Click there, new Query "Search SMTP proxy Address" Description will be lookup SMTP address (anything you like) Click Define Query; click Drop down menu custom search, Click Advance ,In LDAP Query box type below LDAP query

Proxy Addresses=SMTP:oz@usa.Redcross.org

Click Ok, Click Ok one more time to get out ,Now you have your query setup and waiting for you

Click on refresh page Icon, you will see the object on the right Pane who has this SMTP proxy address

If you Exit and come back your Saved Query will be there for you, whenever you need to look up and SMTP Proxy address all you need to do is, redefine the query by

Making right click clicking on define query and changing the first part of the LDAP string
Now let's Play with, what we have learned so far, you want to know the
msExchHomeServerName on my play with LDAP and get familiar with it

On one of my previous post I blogged about a trouble, on un installation process of exchange due to an object in AD pointing to a Exchange server, which needs to be decommissioned and even though there is no mailbox exist anymore, un installation fails with an errors saying

"One or more users mailboxes still exist on the server, and uninstall them first before uninstalling Exchange" Hirrrrrrrr such an annoying situation, but fix was easy.

We will create this time, a custom: msExchHomeServerName LDAP Query string.
Go to Exchange Folder under saved queries
Right Click new Query, and name it "msExchHomeServerName"

Description is the same "msExchHomeServerName" or anything you like.
Click on Define Query, Click Drop Down menu Exchange Recipients
Click Advance, Click Field, User Exchange Home Server, Under Condition Click and select "ends with" on the Value Exchange serve name "Ex1VS" this is the name of Exchange server in my environment, Click Add, Click ok.

Now you have chance to see the Query string, this will help and understand more about LDAP string, below is my LDAP string

(&(&(&(& (mailnickname=*) ( (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)((homeMDB=*) (msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList) )))(objectCategory=user)(msExchHomeServerName=*ex1vs)))

Click Ok, and on the right Pane you will get all the mail enabled objects, by the way now you know how many mail enabled objects this server has by looking at the TOP of the Pane Mine has 1891 Object on this server.

Lastly you can make a right click on the saved queries and say, Export List , now you can E-mail this to yourself save it somewhere for future usage

If you play the way I have showed you will have much better understanding on LDAP and LDAP string

Best Regards

Oz Ozugurlu

http://Smtp25.blogspot.com (blog)
http://exchange911.org/cblog/index.php (Forums)

1 comment:

Custom Paper Writing said...

Many institutions limit access to their online information. Making this information available will be an asset to all.