How to remove user mailboxes from Exchange Server
This article explains how to use PowerShell to delete mailboxes from Exchange Server and also ADManager Plus, an integrated web-based Active Directory, Office 365 and Exchange management and reporting solution. It also shows using ADManager Plus will be the easiest way to delete Exchange Server mailboxes.
Steps to use PowerShell to delete Exchange server mailbox.
- Ensure you have the necessary permissions to delete the mailbox.
- Get the name of the user account to which this mailbox belongs, and also decide if you wish to delete the mailbox permanently right away.
- Create the script with these values.
- Execute the script in the PowerShell window.
A sample script to delete mailbox from Exchange Server using PowerShell
Click to copy entire script
Remove-Mailbox -Identity "John Smith"
The script mentioned above shows how you can use PowerShell to delete mailbox in Exchange Server. Note: You cannot use the same script to remove distribution groups from CSV in bulk.
Limitations of using PowerShell to Remove an Exchange Server mailbox.
- To delete mailbox from Exchange Server, you must have the necessary permissions. With ADManager Plus, users privileges in native AD or Exchange doesn't have to be elevated, and they can be allowed to do this operation only in specific OUs or domains.
- To user PowerShell to bulk remove mailbox from Exchange Server, the script has to be modified or a new script has to be created. With ADManager Plus though, it is offered as a built-in option that's available by default.
- You must know how to run the scripts from the PowerShell window or command line. ADManager Plus is purely GUI-based, allowing you to perform all management and reporting actions with just mouse clicks from its web-based console.
- Even a misplaced hyphen, a typo in the LDAP names or lack of sufficient permissions will lead to errors. As all actions in ADManager Plus are GUI-driven, there is no need to write scripts, eliminating the chances of errors.