博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何将特定用户的特定日期的邮件导出为PST,并删除邮件,以节约空间
阅读量:6857 次
发布时间:2019-06-26

本文共 2212 字,大约阅读时间需要 7 分钟。

有这个需求,是因为特大邮件》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:

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): (Part 1 is a must for setting up powershell permissions for first time users)
  • Date range exports with New-MailboxExportRequest: (Great article, but make sure you read through the comments!)

If you have any questions feel free to ask.

转载地址:http://ntjyl.baihongyu.com/

你可能感兴趣的文章
python paramiko模块讲解
查看>>
Windows Phone 7 数据绑定的简单介绍
查看>>
每天一个知识点linux(二)关机重启命令
查看>>
以程序的方式操纵NTFS的文件权限(下)
查看>>
LVM逻辑卷管理
查看>>
zabbix与nagios对比
查看>>
MySQL源码安装完成后修改安装路径启动问题
查看>>
合并下载的Solaris镜像为DVD文件的方法
查看>>
设计ShartPoint的组织结构和成员
查看>>
shell编程入门步步高(一、shell简介)
查看>>
一个简单的HQL优化
查看>>
从股价说起 百神大战凸现百度与腾讯阿里差距
查看>>
MariaDB六之主从复制
查看>>
outlook cannot send this item
查看>>
【Win7下Android native code的编译和调试】
查看>>
【iOS-cocos2d-X 游戏开发之十】自定义各类模版&触屏事件讲解!
查看>>
域环境下如何保护重要资料文件的安全(二)---IRM&RMS(下)
查看>>
服务器升迁架构.png
查看>>
不能联系xx域的域控制器
查看>>
生产网络做portfast等配置对网络的影响
查看>>