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
140 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 35

Assisted Solution

by:Mahesh
Mahesh earned 167 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Guy and Mahesh for your posts.
Much appreciated.
0

Featured Post

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Join & Write a Comment

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now