这个简单的脚本会提示输入目标邮箱、 获得当前用户、 将所需的权限应用到目标邮箱和邮箱导出到 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
Latest posts by Exchange中文站 (see all)
- 微软发布Azure PlayFab公众预览 - 2021年10月22日
- 微软发布全新云计算资料分析工具Azure Synapse - 2020年12月15日
- Exchange Server 版本号和发行日期汇总 - 2020年9月21日
发布于:
浏览:3808 次
还没有评论