Резервное копирование Exchange 2013
В данной статье будет рассмотрено резервное копирование не только баз данных, но и некоторой конфигурации. Например, данные 206 команды сохраняют большенство серверных и пользовательских настроек. Они могут пригодиться при восстановлении в случае когда и контроллер домен вышел из строя и нет его резервных копий. Я рекомендую выполнить данные команды сразу после установки Exchange 2013. Иногда может понадобится узнать настройки по умолчанию.
Get-AcceptedDomain | fl * > c:\backup\Get-AcceptedDomain.txt
Get-ActiveSyncDeviceAccessRule | fl * > c:\backup\Get-ActiveSyncDeviceAccessRule.txt
Get-ActiveSyncDeviceAutoblockThreshold | fl * > c:\backup\Get-ActiveSyncDeviceAutoblockThreshold.txt
Get-ActiveSyncDeviceClass | fl * > c:\backup\Get-ActiveSyncDeviceClass.txt
Get-Mailbox | Get-ActiveSyncDeviceStatistics | fl * > c:\backup\Get-ActiveSyncDeviceStatistics.txt
Get-ActiveSyncMailboxPolicy | fl * > c:\backup\Get-ActiveSyncMailboxPolicy.txt
Get-ActiveSyncOrganizationSettings | fl * > c:\backup\Get-ActiveSyncOrganizationSettings.txt
Get-ActiveSyncVirtualDirectory | fl * > c:\backup\Get-ActiveSyncVirtualDirectory.txt
Get-AddressBookPolicy | fl * > c:\backup\Get-AddressBookPolicy.txt
Get-AddressList | fl * > c:\backup\Get-AddressList.txt
Get-AdminAuditLogConfig | fl * > c:\backup\Get-AdminAuditLogConfig.txt
Get-Mailbox | Get-ADPermission | fl * > c:\backup\Get-ADPermission.txt
Get-ADServerSettings | fl * > c:\backup\Get-ADServerSettings.txt
Get-ADSite | fl * > c:\backup\Get-ADSite.txt
Get-AdSiteLink | fl * > c:\backup\Get-AdSiteLink.txt
Get-AgentLog | fl * > c:\backup\Get-AgentLog.txt
Get-App | fl * > c:\backup\Get-App.txt
Get-AuditLogSearch | fl * > c:\backup\Get-AuditLogSearch.txt
Get-AuthConfig | fl * > c:\backup\Get-AuthConfig.txt
Get-AuthRedirect | fl * > c:\backup\Get-AuthRedirect.txt
Get-AuthServer | fl * > c:\backup\Get-AuthServer.txt
Get-AutodiscoverVirtualDirectory | fl * > c:\backup\Get-AutodiscoverVirtualDirectory.txt
Get-AvailabilityAddressSpace | fl * > c:\backup\Get-AvailabilityAddressSpace.txt
Get-AvailabilityConfig | fl * > c:\backup\Get-AvailabilityConfig.txt
Get-CASMailbox | fl * > c:\backup\Get-CASMailbox.txt
Get-ClassificationRuleCollection | fl * > c:\backup\Get-ClassificationRuleCollection.txt
Get-ClientAccessArray | fl * > c:\backup\Get-ClientAccessArray.txt
Get-ClientAccessServer | fl * > c:\backup\Get-ClientAccessServer.txt
Get-CmdletExtensionAgent | fl * > c:\backup\Get-CmdletExtensionAgent.txt
Get-Contact | fl * > c:\backup\Get-Contact.txt
Get-ContentFilterConfig | fl * > c:\backup\Get-ContentFilterConfig.txt
Get-ContentFilterPhrase | fl * > c:\backup\Get-ContentFilterPhrase.txt
Get-DatabaseAvailabilityGroup | fl * > c:\backup\Get-DatabaseAvailabilityGroup.txt
Get-DatabaseAvailabilityGroupConfiguration | fl * > c:\backup\Get-DatabaseAvailabilityGroupConfiguration.txt
Get-DatabaseAvailabilityGroupNetwork | fl * > c:\backup\Get-DatabaseAvailabilityGroupNetwork.txt
Get-DataClassification | fl * > c:\backup\Get-DataClassification.txt
Get-DeliveryAgentConnector | fl * > c:\backup\Get-DeliveryAgentConnector.txt
Get-DetailsTemplate | fl * > c:\backup\Get-DetailsTemplate.txt
Get-DistributionGroup | fl * > c:\backup\Get-DistributionGroup.txt
foreach ($group in Get-DistributionGroup) { get-distributiongroupmember $group.DisplayName | ft @{expression={$_.displayname};Label="$group"} >> C:\backup\Get-DistributionGroupMember.txt}
Get-DlpPolicy | fl * > c:\backup\Get-DlpPolicy.txt
Get-DlpPolicyTemplate | fl * > c:\backup\Get-DlpPolicyTemplate.txt
Get-DomainController | fl * > c:\backup\Get-DomainController.txt
Get-DynamicDistributionGroup | fl * > c:\backup\Get-DynamicDistributionGroup.txt
Get-EcpVirtualDirectory | fl * > c:\backup\Get-EcpVirtualDirectory.txt
Get-EdgeSubscription | fl * > c:\backup\Get-EdgeSubscription.txt
Get-EdgeSyncServiceConfig | fl * > c:\backup\Get-EdgeSyncServiceConfig.txt
Get-EmailAddressPolicy | fl * > c:\backup\Get-EmailAddressPolicy.txt
Get-EventLogLevel | fl * > c:\backup\Get-EventLogLevel.txt
Get-ExchangeAssistanceConfig | fl * > c:\backup\Get-ExchangeAssistanceConfig.txt
Get-ExchangeCertificate | fl * > c:\backup\Get-ExchangeCertificate.txt
Get-ExchangeDiagnosticInfo | fl * > c:\backup\Get-ExchangeDiagnosticInfo.txt
Get-ExchangeServer | fl * > c:\backup\Get-ExchangeServer.txt
Get-ExchangeServerAccessLicense | fl * > c:\backup\Get-ExchangeServerAccessLicense.txt
Get-ExchangeServer | Get-FailedContentIndexDocuments | fl * > c:\backup\Get-FailedContentIndexDocuments.txt
Get-ForeignConnector | fl * > c:\backup\Get-ForeignConnector.txt
Get-FrontendTransportService | fl * > c:\backup\Get-FrontendTransportService.txt
Get-GlobalAddressList | fl * > c:\backup\Get-GlobalAddressList.txt
Get-GlobalMonitoringOverride | fl * > c:\backup\Get-GlobalMonitoringOverride.txt
Get-Group | fl * > c:\backup\Get-Group.txt
Get-mailboxserver | Get-HealthReport | fl * > c:\backup\Get-HealthReport.txt
Get-HostedContentFilterRule | fl * > c:\backup\Get-HostedContentFilterRule.txt
Get-HybridConfiguration | fl * > c:\backup\Get-HybridConfiguration.txt
Get-ImapSettings | fl * > c:\backup\Get-ImapSettings.txt
Get-InboxRule | fl * > c:\backup\Get-InboxRule.txt
Get-IntraOrganizationConfiguration | fl * > c:\backup\Get-IntraOrganizationConfiguration.txt
Get-IntraOrganizationConnector | fl * > c:\backup\Get-IntraOrganizationConnector.txt
Get-IPAllowListConfig | fl * > c:\backup\Get-IPAllowListConfig.txt
Get-IPAllowListEntry | fl * > c:\backup\Get-IPAllowListEntry.txt
Get-IPAllowListProvider | fl * > c:\backup\Get-IPAllowListProvider.txt
Get-IPAllowListProvidersConfig | fl * > c:\backup\Get-IPAllowListProvidersConfig.txt
Get-IPBlockListConfig | fl * > c:\backup\Get-IPBlockListConfig.txt
Get-IPBlockListEntry | fl * > c:\backup\Get-IPBlockListEntry.txt
Get-IPBlockListProvider | fl * > c:\backup\Get-IPBlockListProvider.txt
Get-IPBlockListProvidersConfig | fl * > c:\backup\Get-IPBlockListProvidersConfig.txt
Get-IRMConfiguration | fl * > c:\backup\Get-IRMConfiguration.txt
Get-JournalRule | fl * > c:\backup\Get-JournalRule.txt
Get-mailboxserver | Get-LogonStatistics | fl * > c:\backup\Get-LogonStatistics.txt
Get-Mailbox | fl * > c:\backup\Get-Mailbox.txt
Get-MailboxAuditBypassAssociation | fl * > c:\backup\Get-MailboxAuditBypassAssociation.txt
Get-MailboxAutoReplyConfiguration -Identity * | fl * > c:\backup\Get-MailboxAutoReplyConfiguration.txt
Get-MailboxDatabase | fl * > c:\backup\Get-MailboxDatabase.txt
Get-MailboxDatabaseCopyStatus | fl * > c:\backup\Get-MailboxDatabaseCopyStatus.txt
Get-mailbox | Get-MailboxFolderPermission | fl * > c:\backup\Get-MailboxFolderPermission.txt
Get-mailbox | Get-MailboxFolderStatistics | fl * > c:\backup\Get-MailboxFolderStatistics.txt
Get-mailbox | Get-MailboxJunkEmailConfiguration | fl * > c:\backup\Get-MailboxJunkEmailConfiguration.txt
Get-mailbox | Get-MailboxMessageConfiguration | fl * > c:\backup\Get-MailboxMessageConfiguration.txt
Get-mailbox | Get-MailboxPermission | fl * > c:\backup\Get-MailboxPermission.txt
Get-mailbox | Get-MailboxRegionalConfiguration | fl * > c:\backup\Get-MailboxRegionalConfiguration.txt
Get-MailboxSearch | fl * > c:\backup\Get-MailboxSearch.txt
Get-MailboxServer | fl * > c:\backup\Get-MailboxServer.txt
Get-mailbox | Get-MailboxSpellingConfiguration | fl * > c:\backup\Get-MailboxSpellingConfiguration.txt
Get-mailbox | Get-MailboxStatistics | fl * > c:\backup\Get-MailboxStatistics.txt
Get-MailboxTransportService | fl * > c:\backup\Get-MailboxTransportService.txt
Get-MailContact | fl * > c:\backup\Get-MailContact.txt
Get-MailPublicFolder | fl * > c:\backup\Get-MailPublicFolder.txt
Get-MailUser | fl * > c:\backup\Get-MailUser.txt
Get-MalwareFilteringServer | fl * > c:\backup\Get-MalwareFilteringServer.txt
Get-MalwareFilterPolicy | fl * > c:\backup\Get-MalwareFilterPolicy.txt
Get-MalwareFilterRule | fl * > c:\backup\Get-MalwareFilterRule.txt
Get-ManagementRole | fl * > c:\backup\Get-ManagementRole.txt
Get-ManagementRoleAssignment | fl * > c:\backup\Get-ManagementRoleAssignment.txt
Get-ManagementScope | fl * > c:\backup\Get-ManagementScope.txt
Get-MapiVirtualDirectory | fl * > c:\backup\Get-MapiVirtualDirectory.txt
Get-Message | fl * > c:\backup\Get-Message.txt
Get-MessageCategory | fl * > c:\backup\Get-MessageCategory.txt
Get-MessageClassification | fl * > c:\backup\Get-MessageClassification.txt
Get-MessageTrackingLog | fl * > c:\backup\Get-MessageTrackingLog.txt
Get-MigrationBatch | fl * > c:\backup\Get-MigrationBatch.txt
Get-MigrationConfig | fl * > c:\backup\Get-MigrationConfig.txt
Get-MigrationEndpoint | fl * > c:\backup\Get-MigrationEndpoint.txt
Get-MigrationStatistics | fl * > c:\backup\Get-MigrationStatistics.txt
Get-MigrationUser | fl * > c:\backup\Get-MigrationUser.txt
Get-MobileDevice | fl * > c:\backup\Get-MobileDevice.txt
Get-MobileDeviceMailboxPolicy | fl * > c:\backup\Get-MobileDeviceMailboxPolicy.txt
Get-MoveRequest | fl * > c:\backup\Get-MoveRequest.txt
Get-NetworkConnectionInfo | fl * > c:\backup\Get-NetworkConnectionInfo.txt
Get-Notification | fl * > c:\backup\Get-Notification.txt
Get-OabVirtualDirectory | fl * > c:\backup\Get-OabVirtualDirectory.txt
Get-OfflineAddressBook | fl * > c:\backup\Get-OfflineAddressBook.txt
Get-OrganizationalUnit | fl * > c:\backup\Get-OrganizationalUnit.txt
Get-OrganizationConfig | fl * > c:\backup\Get-OrganizationConfig.txt
Get-OrganizationRelationship | fl * > c:\backup\Get-OrganizationRelationship.txt
Get-OutlookAnywhere | fl * > c:\backup\Get-OutlookAnywhere.txt
Get-OutlookProtectionRule | fl * > c:\backup\Get-OutlookProtectionRule.txt
Get-OutlookProvider | fl * > c:\backup\Get-OutlookProvider.txt
Get-OwaMailboxPolicy | fl * > c:\backup\Get-OwaMailboxPolicy.txt
Get-OwaVirtualDirectory | fl * > c:\backup\Get-OwaVirtualDirectory.txt
Get-PartnerApplication | fl * > c:\backup\Get-PartnerApplication.txt
Get-PendingFederatedDomain | fl * > c:\backup\Get-PendingFederatedDomain.txt
Get-PolicyTipConfig | fl * > c:\backup\Get-PolicyTipConfig.txt
Get-PopSettings | fl * > c:\backup\Get-PopSettings.txt
Get-PowerShellVirtualDirectory | fl * > c:\backup\Get-PowerShellVirtualDirectory.txt
Get-PublicFolder | fl * > c:\backup\Get-PublicFolder.txt
Get-PublicFolder | Get-PublicFolderClientPermission | fl * > c:\backup\Get-PublicFolderClientPermission.txt
Get-PublicFolderDatabase | fl * > c:\backup\Get-PublicFolderDatabase.txt
Get-PublicFolder | Get-PublicFolderItemStatistics | fl * > c:\backup\Get-PublicFolderItemStatistics.txt
Get-PublicFolder | Get-PublicFolderMailboxDiagnostics | fl * > c:\backup\Get-PublicFolderMailboxDiagnostics.txt
Get-PublicFolderMailboxMigrationRequest | fl * > c:\backup\Get-PublicFolderMailboxMigrationRequest.txt
Get-PublicFolder | Get-PublicFolderMailboxMigrationRequestStatistics | fl * > c:\backup\Get-PublicFolderMailboxMigrationRequestStatistics.txt
Get-PublicFolderMigrationRequest | fl * > c:\backup\Get-PublicFolderMigrationRequest.txt
Get-PublicFolder | Get-PublicFolderMigrationRequestStatistics | fl * > c:\backup\Get-PublicFolderMigrationRequestStatistics.txt
Get-PublicFolderMoveRequest | fl * > c:\backup\Get-PublicFolderMoveRequest.txt
Get-PublicFolder | Get-PublicFolderMoveRequestStatistics | fl * > c:\backup\Get-PublicFolderMoveRequestStatistics.txt
Get-PublicFolderStatistics | fl * > c:\backup\Get-PublicFolderStatistics.txt
Get-Mailbox | Get-PushNotificationSubscription | fl * > c:\backup\Get-PushNotificationSubscription.txt
Get-Queue | fl * > c:\backup\Get-Queue.txt
Get-ReceiveConnector | fl * > c:\backup\Get-ReceiveConnector.txt
Get-Recipient | fl * > c:\backup\Get-Recipient.txt
Get-RecipientFilterConfig | fl * > c:\backup\Get-RecipientFilterConfig.txt
Get-RemoteDomain | fl * > c:\backup\Get-RemoteDomain.txt
Get-RemoteMailbox | fl * > c:\backup\Get-RemoteMailbox.txt
Get-ResourceConfig | fl * > c:\backup\Get-ResourceConfig.txt
Get-ResubmitRequest | fl * > c:\backup\Get-ResubmitRequest.txt
Get-RetentionPolicy | fl * > c:\backup\Get-RetentionPolicy.txt
Get-RetentionPolicyTag | fl * > c:\backup\Get-RetentionPolicyTag.txt
Get-RMSTemplate | fl * > c:\backup\Get-RMSTemplate.txt
Get-RoleAssignmentPolicy | fl * > c:\backup\Get-RoleAssignmentPolicy.txt
Get-RoleGroup | fl * > c:\backup\Get-RoleGroup.txt
Get-RoleGroup | Get-RoleGroupMember | fl * > c:\backup\Get-RoleGroupMember.txt
Get-RpcClientAccess | fl * > c:\backup\Get-RpcClientAccess.txt
Get-SearchDocumentFormat | fl * > c:\backup\Get-SearchDocumentFormat.txt
Get-SecurityPrincipal | fl * > c:\backup\Get-SecurityPrincipal.txt
Get-SendConnector | fl * > c:\backup\Get-SendConnector.txt
Get-SenderFilterConfig | fl * > c:\backup\Get-SenderFilterConfig.txt
Get-SenderIdConfig | fl * > c:\backup\Get-SenderIdConfig.txt
Get-SenderReputationConfig | fl * > c:\backup\Get-SenderReputationConfig.txt
get-mailboxserver | Get-ServerComponentState | fl * > c:\backup\Get-ServerComponentState.txt
get-mailboxserver | Get-ServerHealth | fl * > c:\backup\Get-ServerHealth.txt
Get-SettingOverride | fl * > c:\backup\Get-SettingOverride.txt
Get-SharingPolicy | fl * > c:\backup\Get-SharingPolicy.txt
Get-SiteMailbox | fl * > c:\backup\Get-SiteMailbox.txt
Get-SiteMailboxProvisioningPolicy | fl * > c:\backup\Get-SiteMailboxProvisioningPolicy.txt
Get-SmimeConfig | fl * > c:\backup\Get-SmimeConfig.txt
get-mailbox | Get-StoreUsageStatistics | fl * > c:\backup\Get-StoreUsageStatistics.txt
Get-SyncConfig | fl * > c:\backup\Get-SyncConfig.txt
Get-SystemMessage | fl * > c:\backup\Get-SystemMessage.txt
get-mailbox | Get-TextMessagingAccount | fl * > c:\backup\Get-TextMessagingAccount.txt
Get-ThrottlingPolicy | fl * > c:\backup\Get-ThrottlingPolicy.txt
Get-ThrottlingPolicyAssociation | fl * > c:\backup\Get-ThrottlingPolicyAssociation.txt
Get-TransportAgent | fl * > c:\backup\Get-TransportAgent.txt
Get-TransportConfig | fl * > c:\backup\Get-TransportConfig.txt
Get-TransportPipeline | fl * > c:\backup\Get-TransportPipeline.txt
Get-TransportRule | fl * > c:\backup\Get-TransportRule.txt
Get-TransportRuleAction | fl * > c:\backup\Get-TransportRuleAction.txt
Get-TransportRulePredicate | fl * > c:\backup\Get-TransportRulePredicate.txt
Get-TransportService | fl * > c:\backup\Get-TransportService.txt
Get-Trust | fl * > c:\backup\Get-Trust.txt
Get-UMActiveCalls | fl * > c:\backup\Get-UMActiveCalls.txt
Get-UMAutoAttendant | fl * > c:\backup\Get-UMAutoAttendant.txt
Get-UMCallAnsweringRule | fl * > c:\backup\Get-UMCallAnsweringRule.txt
Get-UMCallRouterSettings | fl * > c:\backup\Get-UMCallRouterSettings.txt
Get-UMDialPlan | fl * > c:\backup\Get-UMDialPlan.txt
Get-UMHuntGroup | fl * > c:\backup\Get-UMHuntGroup.txt
Get-UMIPGateway | fl * > c:\backup\Get-UMIPGateway.txt
Get-UMMailbox | fl * > c:\backup\Get-UMMailbox.txt
get-mailbox | Get-UMMailboxConfiguration | fl * > c:\backup\Get-UMMailboxConfiguration.txt
Get-UMMailboxPIN | fl * > c:\backup\Get-UMMailboxPIN.txt
Get-UMMailboxPolicy | fl * > c:\backup\Get-UMMailboxPolicy.txt
get-mailbox | Get-UMPhoneSession | fl * > c:\backup\Get-UMPhoneSession.txt
Get-UMService | fl * > c:\backup\Get-UMService.txt
Get-User | fl * > c:\backup\Get-User.txt
Get-UserPhoto | fl * > c:\backup\Get-UserPhoto.txt
Get-UserPrincipalNamesSuffix | fl * > c:\backup\Get-UserPrincipalNamesSuffix.txt
Get-WebServicesVirtualDirectory | fl * > c:\backup\Get-WebServicesVirtualDirectory.txt
Get-X400AuthoritativeDomain | fl * > c:\backup\Get-X400AuthoritativeDomain.txt
Теперь приступаем к резервному копированию баз данных Exchange 2013 (Windows Backup Server должен быть установлен на сервере с Exchange 2013). Информация ниже показывает, что никаких бекапов никогда не было сделано.
Get-MailboxDatabase -status | fl Name,EdbFilePath,*Backup
Name : Mailbox Database 1769149983
EdbFilePath : C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 1769149983\Mailbox Database 1769149983.edb
SnapshotLastFullBackup : True
SnapshotLastIncrementalBackup :
SnapshotLastDifferentialBackup :
SnapshotLastCopyBackup : True
LastFullBackup :
LastIncrementalBackup :
LastDifferentialBackup :
LastCopyBackup :
RetainDeletedItemsUntilBackup : False
Name : DB1
EdbFilePath : E:\DB\DB1.edb
SnapshotLastFullBackup : True
SnapshotLastIncrementalBackup :
SnapshotLastDifferentialBackup :
SnapshotLastCopyBackup : True
LastFullBackup :
LastIncrementalBackup :
LastDifferentialBackup :
LastCopyBackup :
RetainDeletedItemsUntilBackup : False
Выполняем резервную копию только одной базы в ручную с помощью утилиты wbadmin.exe. Место хранения бекапа - общая сетевая папка на контроллеле домена (в идеале хранить копии лучше на сервере, который расположен в отдельном помещении) Скрипт можно запускать с помощью планировщика задач:
C:\>wbadmin.exe START BACKUP -backupTarget:\\dc1\backup\ -include:E: -vssfull -quiet
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2004 Microsoft Corp.
Note: The backed up data cannot be securely protected at this destination.
Backups stored on a remote shared folder might be accessible by other
people on the network. You should only save your backups to a location
where you trust the other users who have access to the location or on a
network that has additional security precautions in place.
Retrieving volume information...
This will back up volume New Volume(E:) to \\dc1\backup\.
The backup operation to \\dc1\backup\ is starting.
Creating a shadow copy of the volumes specified for backup...
Running a consistency check for the application Exchange.
Running a consistency check for the application Exchange.
Creating a backup of volume New Volume(E:), copied (50%).
The backup of volume New Volume(E:) successfully completed.
The backup operation successfully completed.
Summary of the backup operation:
------------------
The backup of volume New Volume(E:) successfully completed.
C:\>Get-MailboxDatabase -status | fl Name,EdbFilePath,*Backup
Name : Mailbox Database 1769149983
EdbFilePath : C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 1769149983\Mailbox Database 1769149983.edb
SnapshotLastFullBackup : True
SnapshotLastIncrementalBackup :
SnapshotLastDifferentialBackup :
SnapshotLastCopyBackup : True
LastFullBackup :
LastIncrementalBackup :
LastDifferentialBackup :
LastCopyBackup :
RetainDeletedItemsUntilBackup : False
Name : DB1
EdbFilePath : E:\DB\DB1.edb
SnapshotLastFullBackup : True
SnapshotLastIncrementalBackup :
SnapshotLastDifferentialBackup :
SnapshotLastCopyBackup : True
LastFullBackup : 10.11.2017 19:34:28
LastIncrementalBackup :
LastDifferentialBackup :
LastCopyBackup :
RetainDeletedItemsUntilBackup : False
Собственно, вот и всё резервное копирование. Довольно таки просто всё делается с помощью комадной строки и powershell. Куда интереснее будет восстанавливать и базу, серверный и пользовательские настройки.
10.11.2017