Enable DKIM by PowerShell in Exchange Online
Prerequisites: Admin acess to the O365 tenant and access to DNS for your Domain
Replace the red highlighted text in the guide, with your domain.
You can get an overview of your DKIM status on your domains at; https://protection.office.com/dkimv2
Here we see DKIM are not enabled at the moment on the domain w365.dk
Connect to Exchange Online PowerShell
Type the command: New-DkimSigningConfig -DomainName w365.dk -Enabled $false
Because I have previously set up DKIM, we get an error here, you will not get this error
Now it’s time to get our DKIM records
Type the command: Get-DkimSigningConfig -Identity w365.dk | fl Selector1CNAME, Selector2CNAME
Now we got our 2 DKIM Records;
Selector 1 record:
- Host name: selector1._domainkey.w365.dk
- Points to address or value: selector1-w365-dk._domainkey.kbhw365dk.onmicrosoft.com
- TTL: 3600
Selector 2 record:
- Host name: selector2._domainkey.w365.dk
- Points to address or value: selector2-w365-dk._domainkey.kbhw365dk.onmicrosoft.com
- TTL: 3600
Login to your DNS hosting service and create the two CNAME records
Then Enable DKIM signing: Set-DkimSigningConfig -Identity w365.dk -Enabled $true
You are done, if you get an error, try wait 10min, and then try the last command again
Official Microsoft documentation; How to use DKIM for email in your custom domain – Office 365 | Microsoft Docs