Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


get the DN of users from thier mailboxes

Posted on 2009-12-20
Medium Priority
Last Modified: 2012-05-08
i want to get the users DN name from a milboxstore in exchnage 2003
by another mean
i have mailbox store in exchange 2003  and i want to get the DN of all users inisde that mailboxstore
Question by:dr_mysterious
  • 2
LVL 71

Expert Comment

by:Chris Dent
ID: 26090180

How far have you got? And what did you want to use for this? It'd be a script if I were to do it.

Typically you'd pull the Legacy Exchange DN value from the Mailbox WMI class, then link that to the same attribute in Active Directory to get the Distinguished Name. It's not perfect, some mailboxes won't have Legacy DNs, and some will be duplicates, but it'll get you almost all the way.

An alternative is to link based on the Mailbox GUID; more robust perhaps, but more complex as you have to deal with converting the value between it's different data formats. It might be good to have an indication of how many mail users you have to determine whether or not that is a good idea.


Accepted Solution

ob1_ earned 100 total points
ID: 26091011
LVL 14

Assisted Solution

Psy053 earned 100 total points
ID: 26092971
You can use DSQuery to get the information you are after:

DSQUERY.exe * -limit 0 -filter "(&(objectclass=user)(objectcategory=person)(homemdb=  ))" -attr distinguishedName

All you need to do is add the DN for the Storage Group within (homemdb= )
LVL 14

Expert Comment

ID: 26093183
Sorry, I probably should have mentioned how to find the DN for your Storage Groups.
It's just another simple DSQuery:

DSQUERY.exe * CN=Configuration,DC=Example,DC=com -limit 0 -filter "(objectClass=msExchPrivateMDB)" -attr distinguishedname

All you need to do for this one is change DC=Example,DC=com to match your environment

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Scripts are great for performing batch jobs against users, however sometimes the GUI is all you need.
Among the most obnoxious of Exchange errors is error 1216 – Attached Database Mismatch error of the Jet Database Engine. When faced with this error, users may have to suffer from mailbox inaccessibility and in worst situations, permanent data loss.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

564 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