Exchange 2007如何从特定邮箱中删除邮件

时间:2012-10-05 22:32:34

标签: windows powershell exchange-server

我想运行一个powershell命令来删除在包含特定主题的特定日期发送给特定个人的邮件。

你可以请一下建议我,或者让我指出一个可以做到这一点的PowerShell脚本的正确方向吗?

非常感谢你的指导。

我发现了一个很酷的剧本:

#Add Exchanage snapin
add-pssnapin Microsoft.Exchange.Management.PowerShell.Admin

#Get list of mailboxes to delete
$users=Get-Content C:\MailboxesToDelete.txt

#For Loop to delete them
foreach ($user in $users)
{
#Print to screen user mailbox to delete
$user
#Delete AD user and Mailbox
Remove-Mailbox -Identity $user -Permanent $true -whatif

#Remove the -whatif if you want to really delete some users.
}

从这里开始:

http://randomtechminutia.wordpress.com/2012/05/03/powershell-script-to-delete-exchange-mailboxes-in-mass/

但这会删除邮箱而不是邮件!

1 个答案:

答案 0 :(得分:1)

请参阅Export-Mailbox cmdlet的帮助。更多信息:

http://technet.microsoft.com/en-us/library/bb266964(v=exchg.80).aspx