Remove-MailboxDatabaseCopy "DB1\Server2"
Note: You will get a warning, but it will disappear. If you have more databases you will need to run the command for each of them. Best copy paste in a text file, save it as remove.ps1 and run it from EMS from another DAG server. Like this:
Remove-MailboxDatabaseCopy "DB1\Server2"
Remove-MailboxDatabaseCopy "DB2\Server2"
Remove-MailboxDatabaseCopy "DB3\Server2"
> After the databases are cleaned up, it is time to remove Server2 configuration from the DAG. For this run below command from EMS:
Remove-DatabaseAvailabilityGroupServer -Identity NADAG1 -MailboxServer Server2 -ConfigurationOnly
If you don't know what the DAG name is, run
​Get-DatabaseAvailabilityGroup
or check using the EMC.
Import-Module ServerManager
Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server -Restart
> Once Server is up. Now run below three commands:
sc config NetTcpPortSharing start= auto
sc config spooler start= disabled
netsh advfirewall set allprofiles state off
> Finally, we need to run recoverserver command and install Exchange again on failed server. For this, launch cmd in admin mode and run below command:
setup /m:recoverserver
Note: Make sure to browse to setup path folder. Then run the above command.
Add-DatabaseAvailabilityGroupServer -Identity NADAG1 -MailboxServer Server2
> Add Database copies. Remember, I told you above to note down activation preference. You need that here:
Add-MailboxDatabaseCopy -Identity DB1 -MailboxServer Server2 -ActivationPreference 1
Add-MailboxDatabaseCopy -Identity DB2 -MailboxServer Server2 -ActivationPreference 2
> Update the database copies by running below command and wait for seeding to complete. You can use EMC also.
Update-MailboxDatabaseCopy -Identity "DB1\Server2" -DeleteExistingFiles
Update-MailboxDatabaseCopy -Identity "DB2\Server2" -DeleteExistingFiles
Now your failed server is up and back into production. Make a back-up, if needed. I hope this will help lot of Exchange admins. If I missed anything let me know.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (1)
Commented:
Stellar Phoenix Mailbox Exchange Recovery Software allows users to mount offline EDB files so that user can view, export, restore the mailboxes data. The DEMO version allows to user to scan and preview the mailboxes. For free trial version, check this link: https://www.stellarinfo.com/edb-exchange-server-recovery.htm