On a Windows computer, open Powershell:
Install ExchangeOnlineManagement
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 1.0.1 import-module exchangeonlinemanagement
Connect to Exchange online
Connect-ExchangeOnline -UserPrincipalName [email protected] -ShowProgress @true
Create a key:
New-DkimSigningConfig -DomainName your.domain.com -KeySize 2048 -Enabled $True
WARNING: The config was created but can’t be enabled because the CNAME records aren’t published. Publish the following two
CNAME records, and then enable the config by using Set-DkimSigningConfig.
selector1-yourdomain-com-au._domainkey.yourdomain.onmicrosoft.com
selector2-yourdomain-com-au._domainkey.yourdomain.onmicrosoft.com
Logon your DNS hosting portal, add below two records:
- Type: cname
- name: selector1._domainkey
- value: selector1-yourdomain-com-au._domainkey.yourdomain.onmicrosoft.com
- TTL: 1 hour
And
- Type: cname
- name: selector2._domainkey
- value: selector1-yourdomain-com-au._domainkey.yourdomain.onmicrosoft.com
- TTL: 1 hour
Wait for about 15 minutes, then issue the below command:
Set-DkimSigningConfig -Identity yourdomain.com -Enabled $true
Now if you logon the Exchange Admin Center > protection > dkim , you will find below:
To find a detailed info about this key:
Get-DkimSigningConfig -Identity yourdomain.com | fl