zoukankan      html  css  js  c++  java
  • 从已删除邮箱copy数据到活动邮箱

    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 Jump . 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/ Jump -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
  • 相关阅读:
    如何退出天擎
    git彻底删除或变更子模块
    湖北校园网PC端拨号算法逆向
    PPPoE中间人拦截以及校园网突破漫谈
    vscode打开django项目pylint提示has not "object" member
    从客户端取到浏览器返回的oauth凭证
    教程视频如何压制体积更小
    windows中的软链接硬链接等
    关于博客园和独立博客的一些打算
    拉勾抓职位简单小爬虫
  • 原文地址:https://www.cnblogs.com/goozgk/p/9700480.html
Copyright © 2011-2022 走看看