Solved

How to delete the old mail boxes in exchange 2007 and free space in the D drive(Exchange database resides)

Posted on 2015-02-13
5
152 Views
Last Modified: 2015-02-13
Hi

We have Exchange 2007 and outlook 2010

We have around 150 users  who have left  our organisation from last 2 years and my predecessors have never deleted their mail boxes. I have taken this job now and want the keep the mail server clean.
Please suggest  the best way of deleting  these mail boxes, if I delete corresponding user  in the active directory , will it delete the mail box as well.
Please post me the right procedure to do this.

Secondly   the space on the D drive is only 43GB remaining ,where the exchange database is hosted  and 349GB has been used.

If I delete all the 150 unwanted mail boxes will I get more space in the D drive.


Thanks
0
Comment
Question by:lianne143
  • 2
  • 2
5 Comments
 
LVL 36

Assisted Solution

by:Mahesh
Mahesh earned 167 total points
ID: 40607599
U can delete user + mailbox or only mailbox
After deletion it will remain for next 30 days on Exchange server

However this will not free space on drive

In order to make free space on drive, create new mailbox database on another drive and move all mailboxes from old database to new one, this will automatically reclaim white space

Once all mailboxes get moved, purge old database from server
0
 
LVL 13

Assisted Solution

by:Guy Lidbetter
Guy Lidbetter earned 333 total points
ID: 40607611
Hi Lianne143,

You can do everything from Exchange regarding deleting the old accounts:
The Remove-Mailbox command will remove both the mailbox and AD User accounts.
You can also do this from the exchange console if you find it easier.

To be more clear on the database cleanup. Once you delete the mailboxes, they will remain in a soft deleted state for 30 days. You can remove these immediately by running a cleanup on the database which will free up "White Space". (scripts at end to help you)

This will not reduce the size of the database, however, the white space will need to be filled up with data before the database can grow again.

The most effective way to reclaim this white space as available drive space would be to move all the mailbox on the database to a new database, then delete the old one. Alternatively you could dismount the database and run an offline defrag which will shrink it but this runs at a speedy +-4GB an hour... so you will be offline a long time.

To clean the database:
1. Update the database to show all disconnected mailboxes:
Get-MailboxDatabase | Clean-MailboxDatabase

2. List all disconnected mailboxes and the disconnect reason (i.e. disabled or soft deleted)
Get-MailboxStatistics -Database "Database" | Where-Object {$_.DisconnectDate -Notlike $NULL} | Format-Table DisplayName, DisconnectDate, MailboxGuid, DisconnectReason –Wrap

3. Remove Soft deleted mailboxes:
$Mailboxes = Get-MailboxStatistics -Database "database" | where {$_.DisconnectReason -eq “SoftDeleted”}
$Mailboxes | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

HTH

Guy
0
 

Author Comment

by:lianne143
ID: 40607631
Thanks guys for your post, I am planning to migrate to exchange 2013, in April. So better to leave it as it is and migrate only the mail box that are required.
Any suggestions?
0
 
LVL 13

Accepted Solution

by:
Guy Lidbetter earned 333 total points
ID: 40607653
Hi Lianne,

I find its always best to make the migration as clean as possible, so you could only really do yourself a favour by getting the current databases as clean as you can.

When you're not worried about what accounts need to go during the stressful period of migration, life is much happier :-)
I wouldn't worry about the database sizes for now though, unnecessary extra work right there...

If you do need any help, you can always find us here...

Regards

Guy
0
 

Author Comment

by:lianne143
ID: 40607819
Thanks Guy and Mahesh for your posts.
Much appreciated.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article runs through the process of deploying a single EXE application selectively to a group of user.
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question