加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

powershell – 如何在交换混合环境中备份/导出office 365电子邮

发布时间:2020-12-13 23:32:30 所属栏目:Windows 来源:网络整理
导读:我们有一个 exchange hybrid environment.(一些用户在onpremises交换,一些用户是办公室365.) 当我们想要从onpremis导出电子邮件时,我们使用下面的命令导出邮箱和存档. New-MailboxExportRequest -Mailbox "user" -FilePath mysrvl$PSTMailbox-user.pst;
我们有一个 exchange hybrid environment.(一些用户在onpremises交换,一些用户是办公室365.)

当我们想要从onpremis导出电子邮件时,我们使用下面的命令导出邮箱和存档.

New-MailboxExportRequest -Mailbox "user" -FilePath mysrvl$PSTMailbox-user.pst; New-MailboxExportRequest -Mailbox "user" -IsArchive  -FilePath mysrvl$PSTMailbox-user-archive.pst -confirm:$false

New-MailboxExportRequest适用于onpremis用户而不适用于office 365.
有没有办法使用PowerShell将Office 365用户邮箱导出到pst?

到目前为止我尝试了什么:

我登录到办公室365

$UserCredential = Get-Credential
Import-Module MSOnline

Connect-MsolService -Credential $UserCredential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication  Basic -AllowRedirection

Import-PSSession $Session

并尝试了New-MailboxExportRequest

但它会产生错误.显然办公室365不知道那个命令

PS C:Userspp> New-MailboxExportRequest
New-MailboxExportRequest : The term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet,function,script file,or operable program. Check the spelling of the name,or if a path was included,verify that the path is
correct and try again.
At line:1 char:1
+ New-MailboxExportRequest
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-MailboxExportRequest:String) [],CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

另外Get-Command * Export *结果如下

尝试谷歌搜索,但找不到可行的选择.有人可以指导我吗?办公环境中的兼容命令是什么?

PS:
我已尝试使用E5许可证https://www.codetwo.com/admins-blog/how-to-export-office-365-mailboxes-to-pst-using-ediscovery/,它在GUI中完美运行.但我的担忧是电子发现,并且有许可证可以使用PowerShell吗?我的意思是通过powershell脚本/自动化?

您无法使用内置工具通过PowerShell将Exchange Online邮箱直接导出到PST.必需的New-MailboxExportRequest在线不存在(或者不向我们的凡人展示).

您可以:

>电子发现,似乎只有GUI.
>将邮箱卸载/迁移到本地Exchange并在本地运行New-MailboxExportRequest(如果需要,还可以迁移回Exchange Online)
>使用各种第三方工具,通过EWS或MAPI执行导出
>脚本委派完全访问权限,Outlook绑定到委派邮箱并导出到PST.技术上很可能,但我从未见过有人这样做过.我没有深入研究eDiscovery,但我相信电子数据展示如何导出到PST(旧交换也用于绑定到Outlook以进行PST导出).但是,如果没有重要的MAPI经验,Outlook COM模型使用起来相当复杂(我已经完成了一些Outlook脚本,但至少可以说仿效PST导出很难).

我和你一样沮丧.为离开的用户导出邮箱以进行长期存储是不必要的烦恼.如果我们可以像导入一样导出到Azure Blob,那将是一个良好的开端.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读