One of the added benefits of the Exchange Management Shell is the ability to run very detailed and customizable reports. With the hundreds of
Get-* cmdlets provided between Windows PowerShell and the Exchange Management Shell, the reporting capabilities are almost endless. In this recipe, we'll cover exporting command output to plain text and CSV files that can be used to report on various resources throughout your Exchange environment.
To export command output to a text file, use the
Out-File cmdlet. To generate a report of mailboxes in a specific mailbox database that can be stored in a text file, use the following command:
Get-Mailbox | Select-Object Name,Alias | Out-File c:\report.txt