Dump Exchange Server 2013 configuration to text files

Similar to my Lync Server related post Dump #Lync configuration to text files

Here are two a nice PowerShell one-liner which will dump all the output of the Exchange related Get- cmdlets to text files depending whether you want basic or full information.  I’ve only tried it with a small Exchange Server 2013 environment

Just open the Exchange Management Shell create a new empty directory and change directory into it and run the cmdlet

Basic

foreach($i in Get-ExCommand | Where-Object {$_.Name -like “Get-*”}){if($i.CommandType -eq “Function”){if (($i.name -eq “Get-ActiveSyncDeviceStatistics”) -or ($i.name -eq “Get-ADPermission”) -or ($i.name -eq “Get-AgentLog”) -or ($i.name -eq “Get-AvailabilityReportOutage”) -or ($i.name -eq “Get-CalendarDiagnosticAnalysis”) -or ($i.name -eq “Get-CalendarDiagnosticLog”) -or ($i.name -eq “Get-CalendarNotification”) -or ($i.name -eq “Get-CalendarProcessing”) -or ($i.name -eq “Get-DistributionGroupMember”) -or ($i.name -eq “Get-ExchangeServerAccessLicenseUser”) -or ($i.name -eq “Get-FailedContentIndexDocuments”) -or ($i.name -eq “Get-FederatedDomainProof”) -or ($i.name -eq “Get-FederationInformation”) -or ($i.name -eq “Get-HealthReport”) -or ($i.name -eq “Get-LogonStatistics”) -or ($i.name -eq “Get-MailboxAutoReplyConfiguration”) -or ($i.name -eq “Get-MailboxCalendarConfiguration”) -or ($i.name -eq “Get-MailboxCalendarFolder”) -or ($i.name -eq “Get-MailboxFolderPermission”) -or ($i.name -eq “Get-MailboxFolderStatistics”) -or ($i.name -eq “Get-MailboxJunkEmailConfiguration”) -or ($i.name -eq “Get-MailboxMessageConfiguration”) -or ($i.name -eq “Get-MailboxPermission”) -or ($i.name -eq “Get-MailboxRegionalConfiguration”) -or ($i.name -eq “Get-MailboxRestoreRequestStatistics”) -or ($i.name -eq “Get-MailboxSpellingConfiguration”) -or ($i.name -eq “Get-MailboxStatistics”) -or ($i.name -eq “Get-ManagementRoleEntry”) -or ($i.name -eq “Get-MessageTrackingLog”) -or ($i.name -eq “Get-MessageTrackingReport”) -or ($i.name -eq “Get-MigrationUserStatistics”) -or ($i.name -eq “Get-MobileDeviceStatistics”) -or ($i.name -eq “Get-MonitoringItemHelp”) -or ($i.name -eq “Get-MonitoringItemIdentity”) -or ($i.name -eq “Get-MoveRequestStatistics”) -or ($i.name -eq “Get-PhysicalAvailabilityReport”) -or ($i.name -eq “Get-PublicFolder”) -or ($i.name -eq “Get-PublicFolderClientPermission”) -or ($i.name -eq “Get-PublicFolderItemStatistics”) -or ($i.name -eq “Get-PublicFolderMailboxDiagnostics”) -or ($i.name -eq “Get-PublicFolderMigrationRequestStatistics”) -or ($i.name -eq “Get-PublicFolderMoveRequestStatistics”) -or ($i.name -eq “Get-PublicFolderStatistics”) -or ($i.name -eq “Get-QueueDigest”) -or ($i.name -eq “Get-RoleGroupMember”) -or ($i.name -eq “Get-ServiceAvailabilityReport”) -or ($i.name -eq “Get-ServiceStatus”) -or ($i.name -eq “Get-SiteMailboxDiagnostics”) -or ($i.name -eq “Get-StoreUsageStatistics”) -or ($i.name -eq “Get-TextMessagingAccount”) -or ($i.name -eq “Get-TransportServer”) -or ($i.name -eq “Get-UMCallDataRecord”) -or ($i.name -eq “Get-UMCallSummaryReport”) -or ($i.name -eq “Get-UMMailboxConfiguration”) -or ($i.name -eq “Get-UMPhoneSession”) -or ($i.name -eq “Get-UserPhoto”)){} Else {. $i.Name | out-file $i”.txt”}}}

Full

foreach($i in Get-ExCommand | Where-Object {$_.Name -like “Get-*”}){if($i.CommandType -eq “Function”){if (($i.name -eq “Get-ActiveSyncDeviceStatistics”) -or ($i.name -eq “Get-ADPermission”) -or ($i.name -eq “Get-AgentLog”) -or ($i.name -eq “Get-AvailabilityReportOutage”) -or ($i.name -eq “Get-CalendarDiagnosticAnalysis”) -or ($i.name -eq “Get-CalendarDiagnosticLog”) -or ($i.name -eq “Get-CalendarNotification”) -or ($i.name -eq “Get-CalendarProcessing”) -or ($i.name -eq “Get-DistributionGroupMember”) -or ($i.name -eq “Get-ExchangeServerAccessLicenseUser”) -or ($i.name -eq “Get-FailedContentIndexDocuments”) -or ($i.name -eq “Get-FederatedDomainProof”) -or ($i.name -eq “Get-FederationInformation”) -or ($i.name -eq “Get-HealthReport”) -or ($i.name -eq “Get-LogonStatistics”) -or ($i.name -eq “Get-MailboxAutoReplyConfiguration”) -or ($i.name -eq “Get-MailboxCalendarConfiguration”) -or ($i.name -eq “Get-MailboxCalendarFolder”) -or ($i.name -eq “Get-MailboxFolderPermission”) -or ($i.name -eq “Get-MailboxFolderStatistics”) -or ($i.name -eq “Get-MailboxJunkEmailConfiguration”) -or ($i.name -eq “Get-MailboxMessageConfiguration”) -or ($i.name -eq “Get-MailboxPermission”) -or ($i.name -eq “Get-MailboxRegionalConfiguration”) -or ($i.name -eq “Get-MailboxRestoreRequestStatistics”) -or ($i.name -eq “Get-MailboxSpellingConfiguration”) -or ($i.name -eq “Get-MailboxStatistics”) -or ($i.name -eq “Get-ManagementRoleEntry”) -or ($i.name -eq “Get-MessageTrackingLog”) -or ($i.name -eq “Get-MessageTrackingReport”) -or ($i.name -eq “Get-MigrationUserStatistics”) -or ($i.name -eq “Get-MobileDeviceStatistics”) -or ($i.name -eq “Get-MonitoringItemHelp”) -or ($i.name -eq “Get-MonitoringItemIdentity”) -or ($i.name -eq “Get-MoveRequestStatistics”) -or ($i.name -eq “Get-PhysicalAvailabilityReport”) -or ($i.name -eq “Get-PublicFolder”) -or ($i.name -eq “Get-PublicFolderClientPermission”) -or ($i.name -eq “Get-PublicFolderItemStatistics”) -or ($i.name -eq “Get-PublicFolderMailboxDiagnostics”) -or ($i.name -eq “Get-PublicFolderMigrationRequestStatistics”) -or ($i.name -eq “Get-PublicFolderMoveRequestStatistics”) -or ($i.name -eq “Get-PublicFolderStatistics”) -or ($i.name -eq “Get-QueueDigest”) -or ($i.name -eq “Get-RoleGroupMember”) -or ($i.name -eq “Get-ServiceAvailabilityReport”) -or ($i.name -eq “Get-ServiceStatus”) -or ($i.name -eq “Get-SiteMailboxDiagnostics”) -or ($i.name -eq “Get-StoreUsageStatistics”) -or ($i.name -eq “Get-TextMessagingAccount”) -or ($i.name -eq “Get-TransportServer”) -or ($i.name -eq “Get-UMCallDataRecord”) -or ($i.name -eq “Get-UMCallSummaryReport”) -or ($i.name -eq “Get-UMMailboxConfiguration”) -or ($i.name -eq “Get-UMPhoneSession”) -or ($i.name -eq “Get-UserPhoto”)){} Else {. $i.Name | FL | out-file $i”.txt”}}}

If your Admin account isn’t UM enabled then you will get an error with the Get-UMCallAnsweringRule cmdlet is run.

Enjoy

Advertisements

One thought on “Dump Exchange Server 2013 configuration to text files

  1. Pingback: ariprotheroe: Dump Exchange Server 2013 configuration to text files « Lync News

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s