我想运行一个 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.
}
从这里:
但这会删除邮箱而不是消息!