5.3. Removing a Mailbox for an Existing User
Problem
You want to remove the mailbox from an account while leaving the account intact.
Solution
Using a graphical user interface
Log on to any machine in your domain that has the Exchange management tools installed.
Open the ADUC snap-in (Users and Computers.msc).
Locate the account whose mailbox you want to delete.
Right-click the target account and choose the Exchange Tasks command.
The Exchange Task Wizard will appear. (You may see a welcome page first; if so, click Next to dismiss it.)
From the Available Tasks window, choose Delete Mailbox and click Next.
The Delete Mailbox page appears, along with a warning that deleting the mailbox will delete the messages it contains. Click Next if you really want it deleted.
The Task in Progress window will briefly appear, then you'll see a completion page that indicates whether the mailbox creation succeeded or not. Click Finish.
Using a command-line interface
Use exchmbx with the
-clear switch to remove the
mailbox from the specified user:
> exchmbx -b <userDN> -clearUsing VBScript
' This code removes the mailbox associated with the specified ' account. Once it's gone, it can still be retrieved, until the ' deleted mailbox retention period expires ' ------ SCRIPT CONFIGURATION ------ strDCName = "<ServerName>" ' e.g., CONT-EXBE01 strUserName = "/cn=<User>, CN=Users,<ForestRootDN>" ' ------ END CONFIGURATION --------- ' find the target user strQuery = "LDAP://" & strDCName & strUserName Set theUser = GetObject(strQuery) ...