【发布时间】:2012-09-27 02:51:00
【问题描述】:
我想运行一个 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.
}
从这里开始:
但这会删除邮箱而不是邮件!
【问题讨论】:
标签: windows powershell exchange-server