creating report of all exchange mailboxes with associated information

steps to create report of all exchange user mailboxes with associated Names, server names, departments and title
(Note, you must have at least exchange recipient management rights to do this)
1. Open Exchange management shell
2. Run the Get mailbox powershell command(see below)
3. Run the Get-user command (see pshell command below). Note that this can take up to 10-15minutes to complete
4. Open MS Access and open the text files to a database and import the text files to respective tables in same database
5. While importing, use fixed width. Name the fields. Choose no primary key
6. After importing, create join between required tables
7. Run query on joined tables
get-mailbox  -ResultSize Unlimited  | ft SamAccountName, DisplayName, ServerName | out-file c:\all-EMTmboxes060309.txt

get-user  -ResultSize Unlimited | where-object{$_.RecipientType –eq “UserMailbox”}| ft SamAccountName, FirstName, LastName, Department, Title | out-file c:\allusermailboxes060309.txt