How to remove Exchange server from DAG

Ok. We have a dual Exchange 2013 setup - EX1 and EX2 - in a DAG . Both servers has the Mailbox & CAS roles
I want to kill the DAG and only have one Exchangeserver being the server EX1.
I've removed the mailbox databases from the EX2 server. But I still have a ton of mailboxes (58) that is on the EX2 server.

[PS] C:\>get-mailbox -server EX2 | sort-object name reveals:
Name          Alias   ServerName       ProhibitSendQuota
----          -----   ----------       -----------------
room1         room1   EX2	         Unlimited
room2         room2   EX2	         Unlimited
user1         user1   EX2	         Unlimited
user2         user2   EX2	         Unlimited

Open in new window

How do I move the mailboxes to the EX1 server?

Thanks
Bjorn DirchsenSysAdmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MASEE Solution Guide - Technical Dept HeadCommented:
Hi Bjorn Dirchsen,
Please use this article to move mailboxes to another database.
https://www.experts-exchange.com/articles/31741/Move-mailboxes-in-bulk-or-one-by-one-to-another-database-in-Exchange-2010-2013-2016.html?headerLink=workspace_article

Use this command to see the databases and server
Get-MailboxDatabase | ft name,server

Open in new window


Use this to move all mailboxes to  one database to another
Get-Mailbox -Database Mailboxdboldserver | New-MoveRequest - TargetDatabase Mailboxdbnewserver -BatchName "Mailboxdboldtomailboxdbnew"

Open in new window

Bjorn DirchsenSysAdmAuthor Commented:
@mas - thank you for the link. All mailboxes are in one Mailbox database - "Mailbox Database Exchange 2013" on EX1. So I don't understand what all the mailboxes are doing on EX2.

[PS] C:\>Get-MailboxDatabase  -identity "Mailbox Database Exchange 2013"

Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
Mailbox Database Exchange 2013 EX1             False           None

Open in new window

AkhaterSolutions ArchitectCommented:
don't rely on you command, since you have a dag the mailboxes are in a db (obviously) which can be hosted on any of the servers in the dag

instead
1. remove the DB copies from EX2
2. remove EX2 from the dag (Remove-DatabaseAvailabilityGroupServer)
3. remove ex1 from your dag (Remove-DatabaseAvailabilityGroupServer)
4. delete your dag (Remove-DatabaseAvailabilityGroup)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

MASEE Solution Guide - Technical Dept HeadCommented:
As commented by Akhater please remove copies
This will remove all copies from EX2 and remove EX2 from DAG.
Get-MailboxDatabaseCopyStatus -Server EX2 | Remove-MailboxDatabaseCopy
Remove-DatabaseAvailabilityGroupServer -Identity ExDAG -MailboxServer EX2

Open in new window

AmitIT ArchitectCommented:
Check my KB:
https://www.experts-exchange.com/articles/18110/How-To-Recover-Failed-Mailbox-Sever-In-Exchange-2010-DAG-Environment.html?headerLink=workspace_article

I wrote this to recover failed server, however you can just follow steps for removing. It is for 2010, however most of the steps will be similar for 2013.
Bjorn DirchsenSysAdmAuthor Commented:
Ok. I'll give it a try in our test environment :)

Thanks everyone for your help so far. I'll keep you posted with my findings.
Bjorn DirchsenSysAdmAuthor Commented:
Hmm. After removing both server Ex1 and EX2 from the DAG, Removing the DAG and uninstalling Exchange from EX2 (EX2 is stil a Domain member server, but no Exchange on it), i still see people on the EX2 when I issue the Get-Mailbox command.

Name          Alias   ServerName       ProhibitSendQuota
----          -----   ----------       -----------------
room1         room1   EX2	         Unlimited
room2         room2   EX2	         Unlimited
user1         user1   EX2	         Unlimited
user2         user2   EX2	         Unlimited

Open in new window


Funny, issuing the command:

[PS] C:\Windows\system32>get-mailbox -server EX2 returns:

Exchange server "EX2" was not found. Please make sure you typed...

I'm at a loss here...
AmitIT ArchitectCommented:
Wait for AD replication, also now your can remove Ex2 from AD.
Bjorn DirchsenSysAdmAuthor Commented:
Ok. Found the reason for the strange behaviour of the Get-mailbox command in this article:

Get-Mailbox does not reflect the correct Server name for Mailboxes on databases for a DAG
Bjorn DirchsenSysAdmAuthor Commented:
Ok. Final question regarding this server decommissionning:

I'm not able to send e-mail (at all) from the OWA to any user in the organisation. The webmail says
Capture.JPG
This appeared after the removal of the EX2 server and DAG.

Any clues?
AkhaterSolutions ArchitectCommented:
Yes I told you to ignore the server in a dag ☺

Regarding your other question, since it is not related to the original one and to be fair with all experts, please consider opening a new thread for it

Thanks
Bjorn DirchsenSysAdmAuthor Commented:
Thanks everyone for the support. I've (almost) succesfully shut down the EX2 and the DAG. The server is operational, but with an (possible directly unrelated) issue with the OWA.

Thanks, guys!
AmitIT ArchitectCommented:
I advise you to recycle your Ex1 server during off hours and check it. Lot of time reboot fixes the issue.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.