• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 831
  • Last Modified:

Retrieving CN from AD/Exchange

Hi,
Next week we are migrating from Small Business Server 2003 to Essential Business Server. Therefor we have to move from exchange 2003 to 2007.

I'm trying to automate Exmerge so that I have a backup PST file of our 60 mailboxes in case things go wrong. However to automate Exmerge I need to put the below text in a file called Mailboxes.txt for each user :

/O=FIRST ORGANIZATION /OU=FIRST ADMINISTRATIVE GROUP /CN=RECIPIENTS /CN=VINCENT

The problem is I don't know what the exchange username (DN) is for each user (vincent in the above example). I'd like to list all these names for every user in 1 operation. So far I tried LDP.exe and ADSI edit but with no luck.
0
vinden
Asked:
vinden
  • 2
2 Solutions
 
abhaighCommented:
what you are wanting is the LegacyExchangeDN

you can extract them via csvde in one shot with

csvde -f mailboxes.csv -r "(& (objectClass=user) (legacyExchangeDN=*))"
0
 
vindenAuthor Commented:
Thanks very much. I'm gonna accept that as an answer.

one last thing though :

Csvde now gives me lots of data per user. It gives me multiple CN's per user for instance. I'm still unsure which CN corresponds to the CN that I need to automate mailboxes with exmerge ?

For some users what exmerge needs is firstname only, for others it's firstname.lastname or fistname lastname and so on.

Exmerge needs this in mailboxes.txt :

/O=FIRST ORGANIZATION /OU=FIRST ADMINISTRATIVE GROUP /CN=RECIPIENTS /CN=VINCENT

CSVDE gives me this for each user :

CN=Vincent mylastnamehere,CN=Users,DC=mydomainhere,DC=local,user,Vincent mylastnamehere,,"CN=Vincent mylastnamehere,CN=Users,DC=mydomainhere,DC=local",4,20060321123146.0Z,20080829092327.0Z,Vincent mylastnamehere,847582,"CN=ISO,CN=Users,DC=mydomainhere,DC=local;CN=Usage Report Users,OU=Security Groups,OU=MyBusiness,DC=mydomainhere,DC=local;CN=allen,CN=Users,DC=mydomainhere,DC=local;CN=Domain Admins,CN=Users,DC=mydomainhere,DC=local",1732490,"CN=Microsoft MTA,CN=SERVER1,CN=Servers,CN=first administrative group,CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomainhere,DC=local",smtp vd@mydomainhere.be;smtp vincent@mydomainhere.be;SMTP vincent.mylastnamehere@mydomainhere.be;X400 c=US\;a= \;p=First Organizati\;o=Exchange\;s=mylastnamehere\;g=Vincent\;,5717D53E-DD6D-4d1e-8A1F-C7BE620F65AA L,"CN=Mailbox Store (SERVER1),CN=First Storage Group,CN=InformationStore,CN=SERVER1,CN=Servers,CN=first administrative group,CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomainhere,DC=local",,TRUE,vincent,X'494d415034c2a731c2a731c2a734c2a749534f2d383835392d31c2a730c2a731c2a730c2a730';X'504f5033c2a731c2a731c2a734c2a749534f2d383835392d31c2a730c2a7c2a7c2a7';X'48545450c2a731c2a731c2a7c2a7c2a7c2a7c2a7c2a7',Vincent mylastnamehere,X'f21c365cd95b0f4fb7a1ce2c989a6f5c',66048,0,0,0,128838172887343750,0,128850264985522250,ADMIN.bat,128309450578775168,513,,X'010500000000000515000000d94d6c95593b656dcdf819e121050000',1,9223372036854775807,1831,vinden,805306368,"CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomainhere,DC=local;CN=All Users,CN=All Address Lists,CN=Address Lists Container,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=mydomainhere,DC=local",/o=First Organization/ou=first administrative group/cn=Recipients/cn=vincent,,"CN=Person,CN=Schema,CN=Configuration,DC=mydomainhere,DC=local",,,,c=US\;a= \;p=First Organizati\;o=Exchange\;s=mylastnamehere\;g=Vincent\;,vincent.mylastnamehere@mydomainhere.be,/o=First Organization/ou=first administrative group/cn=Configuration/cn=Servers/cn=SERVER1,51,X'01000480780000009400000000000000140000000400640001000000000214000300020001010000000000050a00000000000000520031003a003300320036003800000000010000000100000100000020000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000515000000d94d6c95593b656dcdf819e1f4010000010500000000000515000000d94d6c95593b656dcdf819e1f4010000',0,X'a57fb9bdc2fd3b41813760875ae0d881',"{C2253865-8EA6-4E80-99B5-16829D41FB50},{26491CFC-9E50-4857-861B-0CB8DF22B5D7}",mylastnamehere,Vincent,vinden@mydomainhere.local,,,,,,,FALSE,,,,,,,,,,,,,,,,,,      
0
 
abhaighCommented:
the LegacyExchangeDN is what you are after

this "/o=First Organization/ou=first administrative group/cn=Recipients/cn=vincent" is the LegacyExchangeDN in the example cited above

open the output in Excel and delete all unneeded columns

0
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.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now