This is an old revision of the document!
The Exchange System Manager uses the “displayName” attribute, not common name, therefore, the displayName must be included in the initial lookup. I think three fields is fine, CN, DN, displayName…
The base query to get all Exchange mailboxes is:
(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))
Csvde format for this query to retrieve CN's and displayNames:
csvde -f all_exchange.txt -r "(&(&(& (mailnickname=*) (|(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))" -l cn,displayName
Output of that query is simple to parse, and looks like:
DN,cn "CN=102 Philosophy,OU=SIS,DC=ais,DC=columbia,DC=edu",102 Philosophy,102 Philosophy
All users with exchange mailboxes
csvde -f all_exchange.txt -r "(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))" -l cn
Output: List of DNs,CNs. Process: Output insert statements for DNs and CNs Process: Output insert statements for OU
Manual export of CN with mailbox size from System Manager Process: Output update statements with mailbox size where CN=CN.