It comes the day when you finally migrated all your users and mailboxes from onprem to the cloud. This article show the steps needed to disable Azure AD sync from your local domain to Azure AD.
The first step will be to uninstall the Azure AD Sync tool. Uninstall the tool from the server/machine its running on.
In the next step we need to connect to Azure AD via Powershell. This does not work with Linux, that’s why we need a Windows machine. Open Powershell as admin and type the following to install the required cmdlets:
Install-Module -Name MSonline
If you are prompted chose “Y” for yes to install the module.
In the next step we are connecting to Azure AD:
Type in your credentials when the prompt opens and hit Enter.
Now we are going to check whether Azure AD Sync is enabled:
DKIM (Domain Keys Identified Mail) should always be enabled on all of your domains used for email. If you do not enable DKIM your mails may inadvertently get treated as spam. The following tutorial shows you how to enable DKIM for your sending domain(s) in Microsoft365 / Office365.
As the first step we need to connect to our M365 Powershell. The last paragraph in this article describes how to do this.
The following command shows a comprehensive list of DKIM related information for domain “domain.com”:
If we just want to check the DKIM status of our domains we can use the following command:
My example shows that DKIM is enabled for our Microsoft tenant domain but isn’t for our primary sending domain. Before we are able to enable DKIM for our sending domain we need to setup DNS records for verification:
Now we need to set the CNAME records in our dns. Copy selector1 and create a new CNAME entry in your DNS settings. Repeat for selector2 (Destination is just an example, use the output generated in the previous step):
Both selectors must be correctly set before Microsoft allows you to enable DKIM for your domain. If both entries are correct wait another 15 -30 minutes and try to enable DKIM via one of the above options again.
If you need to move a specific mailbox in Microsoft 365 to a different database server, Powershell is your friend. Open a Powershell session and connect to your Microsoft 365 tenant. If you dont know how to connect to M365 via Powershell, check out the last paragraph in this article: Powershell on Linux
First we should check the actual database server the mailbox is located on:
Get-MailboxLocation -Identity email@example.com
As you can see in the above image, the field “DatabaseLocation” shows the hostname of our database server. We are now going to set up a move request for this mailbox. In Microsoft 365 / Exchange Online we are not able to chose the desired server we want to move our mailbox to. Microsoft will move the mailbox to a random, different server:
New-MoveRequest -Identity firstname.lastname@example.org
Once we created the move request we need to wait for the moving provess to finish. We are able to check the status with the following command:
Did you know Powershell is available for Linux too? Sometimes you need the Windows Powershell features available on your Linux machine, e.g. for M365, Exchange Online or Azure AD administration. Powershell can be easily installed but not all features are available.
Linux derivates officially supported for Powershell 7.1:
Ubuntu 19.10 (via snap-packages)
Alpine (from 3.11)
Installation example (Ubuntu 20.04)
You can directly install Powershell via repository:
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of products
sudo apt-get update
# Enable the "universe" repositories
sudo add-apt-repository universe
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
Connect to Office 365 Powershell
After Powershell has been installed, it’s very easy to connect to Office 365. Open the Powershell terminal and type the following (First step will ask for O365 admin credentials)