Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 37

Assisted Solution

by:Mahesh
Mahesh earned 668 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 1332 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 1332 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
I don't pretend to be an expert at this, but I have found a few things that are useful. I hope that sharing them here will help others, so they will not have to face some rather hard choices. Since I felt this to be a topic of enough importance and…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

722 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