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
142 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

867 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

23 Experts available now in Live!

Get 1:1 Help Now