切换到宽版
  • 8039阅读
  • 0回复

[求助]使用脚本导出邮箱到.PST文件中 [复制链接]

上一主题 下一主题
 
只看楼主 倒序阅读 0楼  发表于: 2011-03-19
— 本帖被 YOYO 从 Exchange 脚本中心 移动到本区(2015-06-25) —
  • 脚本环境:PowerShell
  • 适合版本:Exchange 2007
  • 适用平台:
使用此脚本可以将用户邮箱导出成为一个.PST文件。

$TargetUserName = Read-Host “Enter the user you would like to Export”
$TargetArchiveDir = Get-Item “\\FILE-SERVER\ARCHIVE PST\”
$CurrentHostName = hostname
$CurrentProfile = Gwmi Win32_ComputerSystem -Comp $CurrentHostName
“Logged On As User: ” + $CurrentProfile.UserName
Write-Host “Setting Permissions” -ForeGroundColor Yellow
Add-MailboxPermission -Identity $TargetUserName -User $CurrentProfile.Username -AccessRights ‘FullAccess’
Write-Host “Exporting Mailbox” -ForeGroundColor Yellow
Export-Mailbox -identity $TargetuserName -PSTFolderPath $TargetArchiveDir -Confirm:$True
Write-Host “You can now Delete the user – I’m too scared to do it for you!” -ForeGroundColor Yellow
分享到
快速回复
限60 字节
 
上一个 下一个