Categories
Exchange Microsoft Office 365 PowerShell

Enable a Remote Mailbox in Office 365

So I recently ran into an issue where I had a user who’s Local AD account had been deleted but their Office 365 Mailbox was still showing up. We tried to bring the user account back, however the AD recycle bin was not enabled. So we had to create a brand new account for the user and then work from there.

We originally planned to create a new mailbox and let the user start from scratch. However we ran into an issue were the old mailbox would not go away, and it was preventing us from migrating a new mailbox into Exchange Online for the user.

I then found the following Exchange Management Shell command which will allow you to connect the local AD account to the Exchange Online Mailbox.

Enable-RemoteMailbox USERNAME -RemoteRoutingAddress [email protected]

After running the command the user is now able to log in with their new AD account and have access to their mailbox.

I hope you found this post helpful, and if you did, please share it with your friends.

Categories
Exchange Microsoft Office 365 PowerShell Windows

Office 365 Hybrid – Shared Mailboxes Created in Exchange Online do not appear to users whose mailboxes exist on local Exchange

I have been working on an Hybrid Exchange Solution using Office 365. The Client has several shared mailboxes and I wanted to see if a Shared Mailbox created in Office 365 would appear for users who have not been migrated.

Long Story short, the answer is no, they cannot. The reason for this is actually pretty simple. Anything created in Office 365 is not assigned a GUID by Active Directory (because we are only doing a unidirectional sync) so Exchange does not have any record of it.

 It turns out however, that if you migrate the mailbox to the On Premise Exchange server a GUID can be assigned.

I found this Article on Microsoft’s support site on how to do it:
https://support.microsoft.com/en-us/help/3129334/users-in-a-hybrid-deployment-can-t-access-a-shared-mailbox-that-was-cr

Here is the process that you would need to follow in order to get it to work

Please note, the website says that you do not need to do this if your are running Exchange 2016 CU 10 or later. The Client was running 13 at the time, however these steps did work.

  1. Convert the shared mailbox to a regular mailbox by using the Exchange admin center in Exchange Online. To do this, follow these steps:
    1. Open the Exchange admin center in Exchange Online.
    2. Click recipients, and then click shared.
    3. Select the shared mailbox, and then click Convert.
    4. On the Warning page, select Yes to convert the shared mailbox.
  2. Create an on-premises object for the cloud mailbox by using the New-RemoteMailbox cmdlet in the Exchange Management Shell.

    Note This object must have the same name, alias, and user principal name (UPN) as the cloud mailbox.
  3. Set the ExchangeGuid property on the new on-premises object that you created in step 2 to match the cloud mailbox. To do this, follow these steps:
    1. Connect to Exchange Online by using a remote session of Windows PowerShell.
    2. Use the Get-Mailbox cmdlet to retrieve the value of the ExchangeGuid property of the cloud mailbox. For example, run the following command:

      Get-Mailbox <MailboxName> | FL ExchangeGuid 
    3. Open the Exchange Management Shell on the on-premises Exchange server.
    4. Use the Set-RemoteMailbox cmdlet to set the value of the ExchangeGuid property on the on-premises object to the value that you retrieved in step 3b. For example, run the following command:
      Set-RemoteMailbox <MailboxName> -ExchangeGuid <GUID>
  4. Wait for directory synchronization to occur. Or, force directory synchronization.
  5. Make sure that the Office 365 user object is displayed as “Synced with Active Directory.”
  6. Move the mailbox from Exchange Online to the on-premises environment.
  7. Convert the mailbox to a shared mailbox by using the Set-Mailbox cmdlet in the Exchange Management Shell. For example, run the following command:
    Set-Mailbox <MailboxName> -Type Shared
  8. Move the mailbox from the on-premises environment to Exchange Online.
I hope you found this guide helpful, and if you do please tell your friends.

Office 365 user names with ADSync have the OnMicrosoft.com Domain

So I have been working on a Exchange 2016/Office 365 Hybrid solution. Part of the setup is to install and configure ADSync which depending on the day of the week it could either be a Office 365 or Azure Utility. I have honestly installed this tool several times, and it is never in the same place every time I need to download it.

Once ADSync is installed, It will sync your Local AD Users to Office 365/Azure AD. Depending on how you configure the Sync, it could synchronize the whole AD Forrest, an OU (or Multiple OUs), or a Group. In my case I selected 1 of our OUs.

Within 30 minutes all of my users in that OU were sync’d with Office 365/Azure AD. However all of my users had a @company.OnMicrosoft.com user name. Normally this would not be a problem, however I am sure this would be confusing to some users. I also noticed that the usernames were also not consistent either.  Some of them looked like this:

[email protected]

or

[email protected]

After scouring the internet I found nothing on how to fix this for my users. I was just about to open a ticket with Office 365 Support when I found a Technet Article that talked about how the usernames are generated when using ADSync.

To Paraphrase the article, the username in Office 365 is set by the user’s Alias set in Exchange. Which led me to believe that we really have some inconsistent naming going on at my office but that is for another day.

The Article also covered how to change the user names. This let me to believe that I could use this same method for changing the domain name as well, and it worked!

Here is what you will need to do

Connect to Office 365:

Connect-MsolService

Then use this command:

Set-MsolUserPrincipalName -UserPrincipalName [email protected] -NewUserPrincipalName [email protected]

If you don’t get an error message then you should be able to click the refresh button in Office 365 for the user account and you will see the new name.