Del via


A Powershell script to help you validate your DKIM config in Office 365

One of our support engineers (not me, so let’s give credit where credit is due) wrote a script to help you, as a customer of Office 365, validate for DKIM configuration once you have enabled it in the Admin Portal. We’ve added a few more checks to make it more clear, but you can also use this.

To verify your DKIM configuration:

1. Copy/paste the below script into a file, Validate-DkimConfig.ps1

2. Connect to Exchange Online using Powershell, making sure that the directory you are in is the same as where you saved the script above.

3. Type the following command in Powershell:

. .\Validate-DkimConfig.ps1.

4. To check the config for a single domain, run the following command:

Validate-DkimConfig <domain>

To show the full signing config, use the –showAll switch:

Validate-DkimConfig <domain> –showAll

To validate all domains for your organization, run the following command:

Validate-DkimConfig

You will be able to see if anything is wrong because the output is color coded.


Update on May 12, 2016 - This script now lives on GitHub (instead of you having to copy/paste it here), and it fixes some key/dns missing errors https://github.com/carlnolan/scripting/blob/master/Validate-DkimConfig.ps1

Thanks to Carl Nolan for putting this up.

Comments

  • Anonymous
    March 08, 2016
    Fantastic!  Thank you for sharing.

  • Anonymous
    March 10, 2016
    Nice... I will use this!! Thanks for sharing!

  • Anonymous
    March 13, 2016
    Hi Any replacement for Resolve-DnsName for people not running Windows 8/2012 ?

  • Anonymous
    March 15, 2016
    I just tested its not resolving Validate-DkimConfig <domain> command.

    • Anonymous
      May 12, 2016
      • Small changes you need to make in the instructions as the article says that we need to run the script using \Validate-DkimConfig.ps1.• I just tried using the command : Import-Module .\Validate-DkimConfig.ps1 and then it worked as expected.
  • Anonymous
    March 15, 2016
    Awersome! Terry, +1 to Grzegorz Wierzbicki. On W7 machine i didn't have Resolve-DnsName unfortunately.

  • Anonymous
    April 05, 2016
    The comment has been removed

  • Anonymous
    April 28, 2016
    The comment has been removed