This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
exchange:reporting_project:query_notes [2009/12/09 05:37] ben created |
exchange:reporting_project:query_notes [2009/12/11 11:53] (current) ben |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== LDAP ====== | ====== LDAP ====== | ||
===== All Exchange Mailboxes ===== | ===== All Exchange Mailboxes ===== | ||
+ | |||
+ | 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: | The base query to get all Exchange mailboxes is: | ||
<code> | <code> | ||
Line 7: | Line 10: | ||
=== Csvde === | === Csvde === | ||
- | Csvde format for this query to retrieve CN's: | + | Csvde format for this query to retrieve CN's and displayNames: |
<code> | <code> | ||
- | csvde -f all_exchange.txt -r "(&(&(& (mailnickname=*) (|(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))" -l cn | + | csvde -f all_exchange.txt -r "(&(&(& (mailnickname=*) (|(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))" -l cn,displayName |
</code> | </code> | ||
Output of that query is simple to parse, and looks like: | Output of that query is simple to parse, and looks like: | ||
<code> | <code> | ||
DN,cn | DN,cn | ||
- | "CN=102 Philosophy,OU=SIS,DC=ais,DC=columbia,DC=edu",102 Philosophy | + | "CN=102 Philosophy,OU=SIS,DC=ais,DC=columbia,DC=edu",102 Philosophy,102 Philosophy |
- | "CN=210 Kent Conference Rm,OU=SFS,DC=ais,DC=columbia,DC=edu",210 Kent Conference Rm | + | </code> |
- | "CN=Fred Arce,OU=Central Admin,OU=Medical Center,DC=ais,DC=columbia,DC=edu",Fred Arce | + | ===== Queries required ===== |
- | "CN=Adnan Akram,OU=Central Admin,OU=Medical Center,DC=ais,DC=columbia,DC=edu",Adnan Akram | + | |
+ | All users with exchange mailboxes | ||
+ | <code>csvde -f all_exchange.txt -r "(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) ))))" -l cn | ||
+ | </code> | ||
+ | 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. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Common Name ===== | ||
+ | |||
+ | CN and DN are used universally throughout LDAP and Microsoft's AD infrastructure, including Exchange Server 2003 System Manager. The DN is more specific, and should be used for the unique identifier of an object. The CN is easier to parse, and can be used in a lot of cases. | ||
+ | |||
+ | The simplest LDAP lookup for a Common Name looks like: | ||
+ | <code> | ||
+ | (cn=102 Philosophy) | ||
+ | </code> | ||
+ | Multiple CN's can be looked up via the OR operator, "!", as such: | ||
+ | <code> | ||
+ | (!(cn=102 Philosophy)(cn=Ben Hall)) | ||
</code> | </code> | ||