How to bulk delete mailboxes on MS exchange 2013

Deen Uthman 41 Reputation points
2023-07-04T18:37:10.01+00:00

Hi all,

House keeping task to delete multiple user mailboxes on MS Exchange 2013 platform, so desperately seeking PowerShell command to delete multiple mailboxes.

Exchange | Exchange Server | Other
Exchange | Other
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao 37,746 Reputation points Moderator
    2023-07-05T01:32:52.9033333+00:00

    Hi @Deen Uthman

    Kindly note that since Exchange 2013 has reached end of support in 2023.4.11, if possible please consider upgrading to Exchange 2016 or 2019 for better support.


    If the requirement is to simply disable mailbox for these users (not also delete their AD accounts), you can prepare a csv file with the format like:

    01

    Add the mailboxes' email addresses you would like to delete in the csv file, then run the following script in Exchange Management Shell:

    import-csv C:\public\disable_mailbox.csv | foreach{Disable-Mailbox -identity $_.EmailAddress -Confirm:$false}
    

    If you would like to also delete the AD accounts, modify the script to:

    import-csv C:\public\disable_mailbox.csv | foreach{Remove-Mailbox -identity $_.EmailAddress -Confirm:$false}
    

    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.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deen Uthman 41 Reputation points
    2023-07-21T04:35:07.5266667+00:00

    Yes, the PowerShell command worked perfectly. Had an issues with a number of account that would not bulge, kept coming up with access denied restrictions error message, so I had to enable the AD user account inheritance security parameter. Once I changed it, tried again and was able to delete the remaining accounts.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.