none
Office 365 Remove User PS Exchange RRS feed

  • General discussion

  • I recently ran into this problem migrating on-prem to O365 mailboxes. Data migrations would fail with not much information. Under Exchange - Mailboxes - Migration I get the following error:

    Status: Failed
    jsmith@conteso.com Skipped item details
    User status
    Data migrated:
    Migration rate:
    Last successful sync date:
    Error: MigrationPermanentException: Target user ‎'John Smith already has a primary mailbox. --> Target user ‎'John Smith' already has a primary mailbox

    The user account was licensed ahead of the migration and hybrid exchange setup. In order to remove the above user you must connect to your O365 Exchange server.

    But first follow this document to install the needed files:

    https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-office-365-powershell

    You will not be able to delete the mailbox until you follow that guide.

    This is my excerpt:

    • Launch Administrator: Windows PowerShell
    • Run this command: Install-Module -Name AzureAD
    • Connect-AzureAD
    • If you get an error on Win 10: Install .NETFramework 3.5
    • Download MOSSI Assistant https://www.microsoft.com/en-us/download/confirmation.aspx?id=41950
    • Run the Install-Module MSOnline command.
    • If prompted to install the NuGet provider, type Y and press ENTER.
    • If prompted to install the module from PSGallery, type Y and press ENTER.
    • Connect-MsolService
    • If you don't receive any errors, you connected successfully. A quick test is to run an Office 365 cmdlet—for example, Get-MsolUser—and see the results.

    After you can confirm you get the list of users try the following commands:

    Remove-MsolUser –UserPrincipalName user@domain.com

    Remove-MsolUser –UserPrincipalName user@domain.com -RemoveFromRecycleBin

    Return to Data Migration and perform task again.

    Thursday, September 5, 2019 7:05 PM

All replies

  • The issue occurs when you assign the license  to user as  soon  they are synced  office 365 ( which  creates  a mailbox in cloud) and then try migrate  the mailbox from on-prem.


    S_K_P

    Thursday, September 5, 2019 7:17 PM