MS MVP的牛文 ---- Removing disconnected mailboxes in Exchange Server 2007
2008-11-21 15:58
253 查看
From: 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
- Ex2010-15 Shared mailboxes in Exchange
- How to Export Mailboxes with Exchange Server 2010 SP1(带状态查看,清除请求,归档备份)
- Davmail+ThunderBird 连接MS Exchange Server
- 关于javamail-with-ms-exchange-no-authentication-mechansims-supported-by-both-server错误的解决办法
- Troubleshoot mail relay issues in Exchange Server 2003 and in Exchange 2000 Server
- Ex2010-17 Linked Mailbox in Exchange Server
- how to setup DatabaseMail(with MS Exchange Server)
- Exporting Mailbox Data to a PST File in Exchange 2007 SP1(如何导出邮箱数据为PST文件)
- Exchange 2010 FAQ: Why Can’t I Manage Mailboxes in AD Users & Computers Any More?
- How to Reseed a Failed Mailbox Database Copy in Exchange Server 2010
- Convert Geometry data into a Geography data in MS SQL Server
- MCITP: Microsoft Exchange Server 2007 Messaging Design and Deployment Study Guide
- 通过IMAP方式迁移U-Mail邮件到Exchange 2013之将邮件导入到Exchange 2007!
- Get MailStore Size Exchange 2007
- Default settings for Exchange-related virtual directories in Exchange Server 2010
- Mastering Microsoft Exchange Server 2007 SP1