Manually Upgrade your DKIM keys in Microsoft Office 365 Exchange Online

Connect to Microsoft Office 365 PowerShell :

For upgrading DKIM keys in Microsoft Office 365 Exchange Online you need to first connect to Microsoft Office 365 PowerShell.

The Microsoft 365 work or school account that you use must be a member of a Microsoft 365 admin role. This is a requirement for PowerShell for Microsoft 365.

PowerShell must be configured to run signed scripts.

  1. Run the following command in an elevated PowerShell session (a PowerShell session that you Run as administrator).

            Set-ExecutionPolicy RemoteSigned

  1. Run this command and enter your Microsoft 365 work or school account credentials.

            $credential = Get-Credential

  1. Run this command to connect to Azure AD by using the Azure Active Directory PowerShell for Graph module.

            Connect-AzureAD -Credential $credential

  1. Run this command to connect to Exchange Online.

            Import-Module ExchangeOnlineManagement

            Connect-ExchangeOnline -Credential $credential -ShowProgress $true

Now you have connected to the Exchange Online PowerShell, refer to below steps for upgrading DKIM keys from 1024-bit key to 2048-bit.

  • Upgrading existing DKIM key:
    1. Run the following command:

            Rotate-DkimSigningConfig -KeySize 2048 -Identity {Guid of the existing Signing Config}

  • Implementing New DKIM key:
    1. Run the following command:

            New-DkimSigningConfig -DomainName {Domain for which config is to be created} – KeySize 2048 -Enabled $True

Leave a Reply