1. Start Windows PowerShell

    Start > search for "PowerShell" > Start Windows PowerShell by clicking on "Run as Administrator".

  2. Connect the Windows PowerShell to Office 365 Exchange Online . Please execute below command in PowerShell.

    $LiveCred = Get-Credential (Supply Exchange Online Admin’s log in credentials in the prompt window)

    Set-ExecutionPolicy Unrestricted (Proceed with Y if prompted)

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUrihttps://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

    Import-PSSession $Session

  3. Verify if the old mailbox is in deleted state.

    Get-Mailbox -SoftDeletedMailbox accounts

  4. If the Mailbox is found collect the ExchangeGuid of the deleted Mailbox.

    (Get-Mailbox -SoftDeletedMailbox Deleted_User_Alias@domain.com ).ExchangeGuid

  5. Collect the ExchangeGuid of the Active Mailbox.
  6. Now copy the data from the deleted mailbox to the new Mailbox.
    • New-MailboxRestoreRequest -SourceMailbox "Guid of Deleted Mailbox copied from step 4" -TargetMailbox "Guid of Deleted Mailbox copied from step 5"  -AllowLegacyDNMismatch -verbose
  7. Monitor the same.
    • Get-MailboxRestoreRequest
  8. Once it is completed all the data would be moved to the new one.

Sample with Regular PowerShell

1)  Verify the active Mailbox.

Get-Mailbox ACTIVE_USER_ALIAS | FL  Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database

2)  Verified the same in the soft deleted list.

Get-Mailbox -SoftDeletedMailbox Deleted_User_Alias | FL Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database

3)  Collect the data about the mailboxes.

Active Mailbox.

Get-Mailbox ACTIVE_USER_ALIAS | FL Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database

Name  : ACTIVE_USER_ALIAS

Alias  : ACTIVE_USER_ALIAS

UserPrincipalName : ACTIVE_USER_ALIAS@domain.com

ExchangeGuid  : b09181cd-9183-4036-8946-9339dfa27702

Guid  : 28101858-670e-4b47-aedc-7f9cc583a80dEmailAddresses  : {SIP:ACTIVE_USER_ALIAS@domain.com, SMTP:ACTIVE_USER_ALIAS@domain.com, smtp:ACTIVE_USER_ALIAS@domain.com}

Deleted Mailbox.

Get-Mailbox -SoftDeletedMailbox Deleted_User_Alias | FL

Name,Alias,UserPrincipalName,ExchangeGuid,Guid,EmailAddresses,Database

Name  : Deleted_User_Alias

Alias  : Deleted_User_Alias

UserPrincipalName : Deleted_User_Alias@domain.com

ExchangeGuid  : b4dc2e0c-d2ba-4524-9722-dd279b6c6f61

Guid  : a3d02e59-60fd-4bca-b9ca-609c2f792891

EmailAddresses  : {SIP:ecbb89072dda4219a644fab1b054efa6;Deleted_User_Alias@domain.com}

Creating the Mailbox restore request.

New-MailboxRestoreRequest -SourceMailbox b4dc2e0c-d2ba-4524-9722-dd279b6c6f61 -TargetMailbox b09181cd-9183-4036-8946-9339dfa27702 -AllowLegacyDNMismatch -Verbose

Once Request created successfully confirmed the batch completed successfully.

Get-MailboxRestoreRequest | FL Identity,requestguid,Status


Sample with GUI with the help of ISE PowerShell

  1. Start the “Windows PowerShell ISE”, connect it to Exchange Online and Execute below commands.
  2. This would show the list of SoftDeletedMaiboxes, please select one in question and click OK (@ Bottom). $DeletedMailbox = Get-Mailbox -SoftDeletedMailbox | Select DisplayName,ExchangeGuid,PrimarySmtpAddress,ArchiveStatus,DistinguishedName | Out-GridView -Title " This is the list of SoftDeletedMaiboxes, please select one." -PassThru
  3. Select the Target Mailbox to which the data needs to be moved.
    1. $MergeMailboxTo = Get-Mailbox | Select Name,PrimarySmtpAddress,DistinguishedName | Out-GridView -Title " Select the Target Mailbox to which the data needs to be moved." –PassThru
    2. Run the Merge Command

       New-MailboxRestoreRequest -SourceMailbox $DeletedMailbox.DistinguishedName -TargetMailbox $MergeMailboxTo.PrimarySmtpAddress –AllowLegacyDNMismatch

  4. View the progress
  5. Grab the restore ID for the one you want progress on.
    • $RestoreProgress = Get-MailboxRestoreRequest | Select Name,TargetMailbox,Status,RequestGuid | Out-GridView -Title "Restore Request List" –PassThru 
  6. Get the progress in Percent complete.
    • Get-MailboxRestoreRequestStatistics -Identity $RestoreProgress.RequestGuid | Select Name,StatusDetail,TargetAlias,PercentComplete

从已删除邮箱copy数据到活动邮箱的更多相关文章

  1. Oracle根据时间恢复已删除提交的数据

    Oracle 根据数据库的时间戳恢复已删除提交的数据 1.选择一个时间点查看表中数据是否是自己想要的数据 Select * from 表名 as of timestamp to_timestamp(‘ ...

  2. Oracle恢复已删除数据

    Oracle恢复已删除的数据,主要有两种方法:SCN和时间戳. 一.通过SCN恢复删除且已提交的数据 1.获得当前数据库的scn号 select current_scn from v$database ...

  3. 同一个事务里 查询 已删除可是未提交的数据[bug记录]

    前几天犯了个低级错误.在一个事务方法里老是查询不到某条记录,可是debug卡住时,用db工具查.又能查出值. 经过一番折腾,原来是我在同一个事务里 查询 了已删除可是未提交的数据.当然查询不到了! . ...

  4. sql server 中删除表中数据truncate和delete的区别(转载自.net学习网)

    我们都知道truncate table可以用来删除整个表的内容,它与delete后面不跟where条件的效果是一样.但除此之外,我们还清楚它们之间有其它的区别吗?本章我们将一起讨论truncate与d ...

  5. Oracle使用游标删除所有用户数据表中的所有记录脚本

    应用场景:因为数据库中的数据涉及机密信息,希望一次性能删除掉所有数据,只保留数据表结构,供新项目开发程序用 测试结果:经查询已删除所有数据 存在问题:数据表如果存在外键的话下面脚本可能执行不成功,请自 ...

  6. 错误 C2280 Union : 尝试引用已删除的函数 以及 警告 C4624 “Grade”: 已将析构函数隐式定义为“已删除”的一种解决方法

    Union 是C/C++语言中的一种结构类型,用于定义可共享内存的数据变量的一种方式,初次使用Union联合体时可能会遇到以下问题: 错误 C2280 Union : 尝试引用已删除的函数 警告 C4 ...

  7. SELECT INTO和INSERT INTO SELECT的区别 类似aaa?a=1&b=2&c=3&d=4,如何将问号以后的数据变为键值对 C# 获取一定区间的随即数 0、1两个值除随机数以外的取值方法(0、1两个值被取值的概率相等) C# MD5 加密,解密 C#中DataTable删除多条数据

    SELECT INTO和INSERT INTO SELECT的区别   数据库中的数据复制备份 SELECT INTO: 形式: SELECT value1,value2,value3 INTO Ta ...

  8. 在 Linux 系统下使用 PhotoRec 工具来恢复已删除或丢失的文件

    PhotoRec – Recover Deleted or Lost Files in Linux 在 Linux 系统下使用 PhotoRec 工具来恢复已删除或丢失的文件 当你在系统中有意或无意地 ...

  9. Oracle的闪回特性之恢复truncate删除表的数据

    Oracle的闪回特性之恢复truncate删除表的数据 SQL> show parameter flashback NAME                                 T ...

随机推荐

  1. vue简单的日历

    <ul class="date"> <li v-for="(item, index) in list" :key="index&qu ...

  2. PHP类自动加载技术

    在我们平时用框架比如laravel时,只要在app目录下的任意路基文件中,如下使用就可以实例化一个对象. $u = new App\Model\User() 我们知道,原生PHP要想实例化一个其他文件 ...

  3. 2017-10-22模拟赛T2 或(or.*)

    题面 [题目描述]你需要构造一个长度为 n 的数列 X,当中的数字范围从 0 到 2^30-1.除此之外你需要满足 m 个条件,第 i 个条件为 X[li]|X[li+1]|……|X[ri]=pi.| ...

  4. React相关:npm,ES6,

    1.NPM: 参考:npm使用入门  npm 学习笔记整理 2.ES6参考:ES6 let命令:ES6新增了let命令,用来声明变量.它的用法类似于var,但是所声明的变量,只在let命令所在的代码块 ...

  5. sourcetree 修改文件后提交上去,文件丢失

    提交sourcetree 修改后,图片资源提交上去了,json文件没提交上去,原因是本地finder隐藏文件.gitignore_global中把一些文件类型都隐藏了不让提交. 具体使用default ...

  6. 我的第一篇博客:vue-cli配置项目

    注意:在安装vue-cli之前一定要确保安装了node和vue 安装配置node:下载node(https://nodejs.org/en/)然后一路无脑安装 查看安装是否成功:node –versi ...

  7. vmware虚拟机安装了linux(redhat)系统忘记登录密码怎么办

    今天,打开了以前装过的vmware虚拟机,正常启动之后,一直想不起登录密码,怎么都是登录不进去.然后在网上查找资料,最后重置了密码.下面,分享下具体操作过程. 1.重新启动虚拟机,在出现启动进度条时按 ...

  8. struts1和struts2和springMVC的区别和介绍

    MVC是web开发常用的模式,M即模型层(Model):主要由javabean来实现.V即视图层(View):主要由jsp.velocity.freemarker等.C即控制层(Controller) ...

  9. ccf-炉石传说-201609-3

    大概是CCF 第三题比较简洁的一道题吧 尽量设计好一个数据结构: node t[2][10]: 存双方的英雄和随从 int    num[2]: 存隋朝的数量 用p来实现双方的切换,因为有统一 的接口 ...

  10. MTLD -词汇复杂度的指标

    论文: MTLD, vocd-D, and HD-D: A validation study of sophisticated approaches to lexical diversity asse ...