get the DN of users from thier mailboxes

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
Who is Participating?
Chris DentPowerShell DeveloperCommented:

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.

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= )
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.