从已删除邮箱copy数据到活动邮箱
- Start Windows PowerShell
Start > search for "PowerShell" > Start Windows PowerShell by clicking on "Run as Administrator".
- 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 -AllowRedirectionImport-PSSession $Session - Verify if the old mailbox is in deleted state.
Get-Mailbox -SoftDeletedMailbox accounts - If the Mailbox is found collect the ExchangeGuid of the deleted Mailbox.
(Get-Mailbox -SoftDeletedMailboxDeleted_User_Alias@domain.com).ExchangeGuid - Collect the ExchangeGuid of the Active Mailbox.
(Get-MailboxACTIVE_USER_ALIAS@domain.com).ExchangeGuid
- 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
- Monitor the same.
Get-MailboxRestoreRequest
- 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
- Start the “Windows PowerShell ISE”, connect it to Exchange Online and Execute below commands.
- 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 - Select the Target Mailbox to which the data needs to be moved.
$MergeMailboxTo = Get-Mailbox | Select Name,PrimarySmtpAddress,DistinguishedName | Out-GridView -Title " Select the Target Mailbox to which the data needs to be moved." –PassThru- Run the Merge Command
New-MailboxRestoreRequest -SourceMailbox $DeletedMailbox.DistinguishedName -TargetMailbox $MergeMailboxTo.PrimarySmtpAddress –AllowLegacyDNMismatch
- View the progress
- 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
- Get the progress in Percent complete.
Get-MailboxRestoreRequestStatistics -Identity $RestoreProgress.RequestGuid | Select Name,StatusDetail,TargetAlias,PercentComplete
从已删除邮箱copy数据到活动邮箱的更多相关文章
- Oracle根据时间恢复已删除提交的数据
Oracle 根据数据库的时间戳恢复已删除提交的数据 1.选择一个时间点查看表中数据是否是自己想要的数据 Select * from 表名 as of timestamp to_timestamp(‘ ...
- Oracle恢复已删除数据
Oracle恢复已删除的数据,主要有两种方法:SCN和时间戳. 一.通过SCN恢复删除且已提交的数据 1.获得当前数据库的scn号 select current_scn from v$database ...
- 同一个事务里 查询 已删除可是未提交的数据[bug记录]
前几天犯了个低级错误.在一个事务方法里老是查询不到某条记录,可是debug卡住时,用db工具查.又能查出值. 经过一番折腾,原来是我在同一个事务里 查询 了已删除可是未提交的数据.当然查询不到了! . ...
- sql server 中删除表中数据truncate和delete的区别(转载自.net学习网)
我们都知道truncate table可以用来删除整个表的内容,它与delete后面不跟where条件的效果是一样.但除此之外,我们还清楚它们之间有其它的区别吗?本章我们将一起讨论truncate与d ...
- Oracle使用游标删除所有用户数据表中的所有记录脚本
应用场景:因为数据库中的数据涉及机密信息,希望一次性能删除掉所有数据,只保留数据表结构,供新项目开发程序用 测试结果:经查询已删除所有数据 存在问题:数据表如果存在外键的话下面脚本可能执行不成功,请自 ...
- 错误 C2280 Union : 尝试引用已删除的函数 以及 警告 C4624 “Grade”: 已将析构函数隐式定义为“已删除”的一种解决方法
Union 是C/C++语言中的一种结构类型,用于定义可共享内存的数据变量的一种方式,初次使用Union联合体时可能会遇到以下问题: 错误 C2280 Union : 尝试引用已删除的函数 警告 C4 ...
- 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 ...
- 在 Linux 系统下使用 PhotoRec 工具来恢复已删除或丢失的文件
PhotoRec – Recover Deleted or Lost Files in Linux 在 Linux 系统下使用 PhotoRec 工具来恢复已删除或丢失的文件 当你在系统中有意或无意地 ...
- Oracle的闪回特性之恢复truncate删除表的数据
Oracle的闪回特性之恢复truncate删除表的数据 SQL> show parameter flashback NAME T ...
随机推荐
- php优秀框架codeigniter学习系列——CI_Controller分析
该类是一个超级大的父类,它将在 CodeIgniter.php 中实例化化过的类,通通加载成它的类成员变量,所以可以方便的进行各种操作.各种应用控制器类,都会继承 CI_Controller 类. _ ...
- 设置eclipse联想功能
当我们在用eclipse的时候,怎么能够让自己的编码速度加快?我想利用eclipse的提示功能是其中的方法之一.下面就利出配置eclipse联想功能(代码的提示功能)的步骤: 1. 打开Eclipse ...
- 2018 ,请领取您Power BI 年终报告
Power BI365 3Jan 2019 新年已至,岁寒温暖! 为方便Power BI用户们能快速找到所需要的Power BI各类型文章,小悦将2018年Power BI的所有精彩文章按照各应用场景 ...
- 天转凉了,注意保暖,好吗(需求规格说明书放在github了)
团队项目——AI五子棋(小程序) 一.团队展示: 队名:未来的将来的明天在那里等你 小组 队员: 龙天尧(队长)(3116005190),林毓植(3116005188),黄晖朝(3116005178) ...
- laravel 错误提示Fatal Error: Class 'Pheanstalk\Pheanstalk' not found
本地环境版本: composer -V Composer version -- ::10 php artisan -V Laravel Framework 5.6.39 错误提示: Fatal Err ...
- 同步I/O、异步I/O与阻塞I/O、非阻塞I/O的区别
一.I/O I/O (Input/Output,输入/输出)即数据的读取(接收)或写入(发送)操作. 通常用户进程中的一个完整I/O分为两阶段:用户进程空间<-->内核空间.内核空间< ...
- memcache 杂记
它是一个一个高性能的分布式内存对象缓存系统. 端口号 11211 目前被许多网站使用以提升网站的访问速度,尤其对于一些大型的. 需要频繁访问数据库的网站访问速度提升效果十分显著 根据一个sql取出的 ...
- SSH(Spring+Struts2+Hibernate) of mappings(SSH三大框架的映射问题)
错误提示: org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity org.hibernate.Mapp ...
- 下载python包
修改pip下载源 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider 更新pip版本 python -m pip inst ...
- JavaScript之更改闭包内的变量值
var f = function( ) { var x = 1 function fo() { console.log( x++ ) } return fo } var fn = f() fn() ...