If you work in an environment that frequently hires new employees, you may have a process in place to provision your mailboxes in bulk. You may have already used this book to help you do that. Now you might like to be able to generate reports or retrieve a list of mailboxes that were created during a specific time frame or after a specific date. In this recipe, you will learn a couple of ways to do that using the Exchange Management Shell.
Let's start off with a simple example. To generate a report of mailboxes created in the last week, execute the following command:
Get-Mailbox -ResultSize Unlimited | ?{$_.WhenMailboxCreated –ge (Get-Date).AddDays(-7)} | Select DisplayName, WhenMailboxCreated, Database | Export-CSV C:\mb_report.CSV -NoType