0

我想运行一个 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/

但这会删除邮箱而不是消息!

4

1 回答 1

1

请参阅Export-Mailboxcmdlet 的帮助。更多信息在这里:

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

于 2012-10-06T11:09:59.287 回答