?
Solved

Deleting Disconnected Mailboxes

Posted on 2008-06-17
2
Medium Priority
?
376 Views
Last Modified: 2010-03-06
I have been trying to figure out how to manually delete mailboxes that are in the ESM under Recipient Configuration / Disconnected Mailboxes.  This is not like Exchange 2003 where you just purge.  I have found the following script in a newsgroup posting, and wonder if it will work.  Looks like it queries to see if and what mailboxes are disconnected then it deletes all it finds?  Anyhow, I don't understand the syntax completely, because I am assumin I need to input some sort of info specific to my situation for it to work?  Basically, I want to delete disconnected mailboxes.


Get-MailboxStatistics -database "server\database" | where
{$_.disconnectdate -ne $null} | foreach {Remove-mailbox -database
$_.database -storemailboxidentity $_.mailboxguid}


0
Comment
Question by:oveloz
[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 Comments
 
LVL 6

Accepted Solution

by:
DocCan11 earned 2000 total points
ID: 21803402
you will have to change the "server\database" to your server and the mailbox database you want it to work against.. that info is then fed into the where-object clause to check and see if the attribute disconnectdate is not null (meaning it has been deleted) the $_ in front of it is there as a sort of current record idea since many could be passed into it..
0
 

Author Comment

by:oveloz
ID: 21825210
Thanks!
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 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