MS MVP的牛文 ---- Removing disconnected mailboxes in Exchange Server 2007
2008-11-21 15:58
471 查看
转载自:http://msmvps.com/blogs/andersonpatricio/archive/2007/10/08/removing-disconnected-mailboxes-in-exchange-server-2007.aspx
Exchange Server 2007 doesn't allow us to purge the disconnected mailbox. In order to remove one or multiple disconnected mailboxes we can be performing these steps:
Listing all disconnected mailboxes
Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid
Removing a single entry
Remove-Mailbox -Database <Database-Name> -StoreMailboxIdentity <MailboxGuid> -confirm:$false
Removing all users at the same time
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid
Now that we have all disconnected mailboxes in a var, we can run the following cmdlet to remove all of them:
$users | ForEach { Remove-Mailbox -Database "Mailbox Database" -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }
=================================================================================
Daniel said:
Just a little improvment to remove on all databases of the server:
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid,Database
$users | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }
Exchange Server 2007 doesn't allow us to purge the disconnected mailbox. In order to remove one or multiple disconnected mailboxes we can be performing these steps:
Listing all disconnected mailboxes
Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid
Removing a single entry
Remove-Mailbox -Database <Database-Name> -StoreMailboxIdentity <MailboxGuid> -confirm:$false
Removing all users at the same time
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid
Now that we have all disconnected mailboxes in a var, we can run the following cmdlet to remove all of them:
$users | ForEach { Remove-Mailbox -Database "Mailbox Database" -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }
=================================================================================
Daniel said:
Just a little improvment to remove on all databases of the server:
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid,Database
$users | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }
相关文章推荐
- MS MVP的牛文 ---- Removing disconnected mailboxes in Exchange Server 2007
- PowerShell to Create New Mailboxes in the smallest database in Exchange 2007 Organization
- Exchange 2010 FAQ: Why Can’t I Manage Mailboxes in AD Users & Computers Any More?
- How to Export Mailboxes with Exchange Server 2010 SP1(带状态查看,清除请求,归档备份)
- How to Reseed a Failed Mailbox Database Copy in Exchange Server 2010
- Exporting Mailbox Data to a PST File in Exchange 2007 SP1(如何导出邮箱数据为PST文件)
- Ex2010-17 Linked Mailbox in Exchange Server
- Davmail+ThunderBird 连接MS Exchange Server
- Troubleshoot mail relay issues in Exchange Server 2003 and in Exchange 2000 Server
- 关于javamail-with-ms-exchange-no-authentication-mechansims-supported-by-both-server错误的解决办法
- how to setup DatabaseMail(with MS Exchange Server)
- Ex2010-15 Shared mailboxes in Exchange
- How to Cheat at Configuring Exchange Server 2007: Including Outlook Web, Mobile, and Voice Access
- Mastering Microsoft Exchange Server 2007
- 通过IMAP方式迁移U-Mail邮件到Exchange 2013之将邮件导入到Exchange 2007!
- [SharePoint] Deployment and Programming AJAX server code in SharePoint 2007
- How to set up a simple mail server on Debian in 5 easy steps
- Move System Databases in MS SQL SERVER
- Sending e-mail from Oracle Server in 10g