Set homemdb value for bulk users in Exchange 2013 environment

Al Amran 326 Reputation points
2021-10-28T01:32:50.717+00:00

Our 2013 exchange environment has been corrupted due to fire incident.

We have tried to restore database from backup as recovery state when we have gotten the database was dirty shutdown state. We tried soft recovery but it's failed. Then we had tried hard recovery and it's came back in clean shut down state.

But it will take tom much time from backup restore. Then we have decided to set all mail users database because all users database is missing.

We tried set-mailbox command to assign database for one user but it's getting error.

After then we have added value in homemdb of one user from ADSI edit, after then user mailbox is connected in database. User is able to login his/her mailbox.

The big challenge is we have 6000 users. How can we add homemdb value for all users by using powershell command or any script?

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,177 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,350 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,886 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KyleXu-MSFT 26,211 Reputation points
    2021-10-29T02:37:57.337+00:00

    @Al Amran

    Prepare a csv file contains the AD account that you want to modify:
    144720-qa-kyle-10-33-01.png

    Then, run script below to modify homeMdb for them:

    $users = Import-Csv c:/temp/users.csv  
    $homeMdb = ""  
      
    foreach ($user in $users){      
        Set-ADUser $user.Name -replace @{homeMdb=$temp}  
    }  
    

    144817-qa-kyle-10-36-49.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.