如何将特定用户的特定日期的邮件导出为PST,并删除邮件,以节约空间

简介: 有这个需求,是因为特大邮件》50G的用户,如果一定次导出为PST,则往往放在OUTLOOK里会读写失败。 于是,分期分批的导出再删除,是一个可行的办法。 关键命令: I recently found myself looking for a way to move old messages to .

有这个需求,是因为特大邮件》50G的用户,如果一定次导出为PST,则往往放在OUTLOOK里会读写失败。

于是,分期分批的导出再删除,是一个可行的办法。

关键命令:

I recently found myself looking for a way to move old messages to .pst in order to reclaim disk space. Things have changed a little since the GUI days of Exmerge.exe and the Export-Mailbox cmdlet of Exchange 2007. They’ve been replaced with New-MailboxExportRequest.

The good news is that the -ContentFilter switch is pretty robust. To export all messages (in all folders) that were delivered prior to May 1st, 2010 I used the following syntax:

New-MailboxExportRequest -Mailbox Barry -IsArchive -ContentFilter {(Received -lt ’05/01/2010′)}  –FilePath “\\barryserver\mailboxexports\barry.pst”

Then to remove the messages that were just exported I ran:

Search-Mailbox Barry -SearchQuery “Received:< $(’05/01/2010 00:00:00′)” -DeleteContent

A few things to point out…

-IsArchive: This switch is telling exchange to grab everything in the mailbox AND the on-line archive. If you’re not using the on-line archive slap yourself, than feel free to remove the switch. You won’t need this with Search-Mailbox because it will check the archive by default. If you want to ignore the archive then the appropriate switch is: DoNotIncludeArchive

Received -lt: lt stands for less than, you can also use -le (less than or equal too) or -ge (greater than or equal to, you get the picture…). I don’t know why the lt switch wont work with the Search-Mailbox command, but it just doesn’t so us the ‘<’ symbol.

-FilePath: This MUST be a UNC path on the local network, no local drives. You also need add full security permissions to the ExchangeTrustedSubsystem account for the folder you are copying to. 

Last but not least run a manual defrag of the exchange database to recover the disk space. here’s a good article on that process: http://exchangeserverpro.com/defrag-exchange-2010-mailbox-database

I recommend you look at the following pages for more info about Export and Import Requests in powershell:

  • Import/Export Mailbox improvements in Exchange 2010 Service Pack 1 (Part 2): Click here. (Part 1 is a must for setting up powershell permissions for first time users)

If you have any questions feel free to ask.

http://www.barrytrujillo.com/wordpress/?p=335

目录
相关文章
|
消息中间件 存储 NoSQL
一文读懂Kafka Connect核心概念
Kafka Connect 是一种用于在 Apache Kafka 和其他系统之间可扩展且可靠地流式传输数据的工具。 它使快速定义将大量数据移入和移出 Kafka 的连接器变得简单。 Kafka Connect 可以摄取整个数据库或从所有应用程序服务器收集指标到 Kafka 主题中,使数据可用于低延迟的流处理。 导出作业可以将数据从 Kafka 主题传送到二级存储和查询系统或批处理系统进行离线分析。
|
JavaScript 前端开发
事件绑定(onclick,onfocus,onblur)
事件绑定(onclick,onfocus,onblur)
545 0
|
9月前
|
设计模式 Java Go
Go中的switch的8种使用场景:没有你想的那么简单
在 Go 中灵活使用 switch,可以使代码更清晰、更易维护。 switch 是 Go 中不可或缺的控制结构之一
1108 0
|
12月前
|
缓存
QLExpress使用及源码分析
本示例演示QLExpress规则引擎的完整使用流程:从实体构建、接口定义到脚本编写,表达式内容由yaml文件(如user.yaml)维护。运行时通过QLExpressRunner解析语法树,支持上下文定制与二次扩展。自动扫描规则脚本,构建AST并执行,支持别名映射与汉化,实现灵活的规则计算与管理。(238字)
364 0
|
消息中间件 Kafka
Kafka【问题记录 01】kill -9 导致 Kakfa 重启失败问题处理(doesn‘t match stored clusterId xxx in meta.properties)
【2月更文挑战第20天】Kafka【问题记录 01】kill -9 导致 Kakfa 重启失败问题处理(doesn‘t match stored clusterId xxx in meta.properties)
668 0
|
存储 人工智能 自然语言处理
云上玩转DeepSeek系列之二:PAI+DeepSeek,打造智能问答助手
本文将为您带来“PAI+DeepSeek,30分钟打造支持连网搜索+私有知识库的智能应用”最佳实践,大模型能力、联网能力再加持 RAG 方案,实现 DeepSeek 系列模型与现有业务的高效融合。
|
人工智能 自动驾驶 算法
积极培养大学生人工智能思维,生成式人工智能认证助力职场未来
随着人工智能技术快速发展,培养大学生的人工智能思维成为高等教育的重要任务。生成式人工智能(GAI)认证由全球终身学习公司培生推出,旨在为学生提供全面的AI技能培训与认证。它涵盖主流AI工具和技术,注重实践应用,提升问题解决能力和创新思维。GAI认证不仅证明个人AI能力、增强职场竞争力,还推动高校课程改革和跨学科融合。对感兴趣者,可访问官网了解详情,开启智能化职场之旅。
|
测试技术 开发者 Python
使用Python解析和分析源代码
本文介绍了如何使用Python的`ast`模块解析和分析Python源代码,包括安装准备、解析源代码、分析抽象语法树(AST)等步骤,展示了通过自定义`NodeVisitor`类遍历AST并提取信息的方法,为代码质量提升和自动化工具开发提供基础。
1947 9
|
编解码 数据可视化 定位技术
60行代码就可以训练/微调 Segment Anything 2 (SAM 2)
本文演示了如何在仅60行代码内(不包括标注和导入)对SAM2进行微调。
1959 1
60行代码就可以训练/微调 Segment Anything 2 (SAM 2)