Solved

Deleting Disconnected Mailboxes

Posted on 2008-06-17
2
372 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
2 Comments
 
LVL 6

Accepted Solution

by:
DocCan11 earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I create a Skype for business online account in power shell 5 41
Prevent spoofed emails for Office 365 customer 4 52
exchange 2013 4 43
exchange, script 6 56
Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
how to add IIS SMTP to handle application/Scanner relays into office 365.

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

22 Experts available now in Live!

Get 1:1 Help Now