Hi @Роман Лазарев ,
Thank you for answer! But solution is to find all accounts with none empty mail attribute but with empty homeMDB and set homeMDB, delete account or delete mail and legacy exchange DN. Maybe it can help someone in the future! Good luck all!
Great to know that you've managed to sort it out and really appreciate it for your sharing!
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
[[exchange 2016] Database is mandatory on usermailbox.]
Issue Symptom:
There is the exchange server 2016 with an error "Database is mandatory on UserMailbox" when i try to use Get-mailbox command or open mailbox properties from ECP.
Root Cause:
But solution is to find all accounts with none empty mail attribute but with empty homeMDB and set homeMDB, delete account or delete mail and legacy exchange DN. Maybe it can help someone in the future! Good luck all!
Get-ADUser -Filter -Properties | where{$.legacyExchangeDN -ne $null -AND $.homeMDB -eq $null} | ft Name
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks!