导出到邮箱.PST

这个简单的脚本会提示输入目标邮箱、 获得当前用户、 将所需的权限应用到目标邮箱和邮箱导出到 PST 文件。
powershell
$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

Exchange中文站

Exchange中文站

Exchange中文站是一个专注讨论 Microsoft Exchange Server / Exchange Online / Office 365 的技术型网站。
Exchange中文站

Exchange中文站 的最新文章 (查看所有)

发布于: 浏览:434 次

还没有评论

欢迎参与到我们的技术讨论,问题和分享都可以。