MediumModule packFree

PowerDMARC

Checks the email authentication that PowerDMARC manages for your domains, starting with Hosted SPF (PowerSPF): DNS lookups, void lookups, errors and the all mechanism. Reads through the PowerDMARC API and changes nothing. By Alweys C//oud (alweys.ch).

By weyCC81 · Version 2.0.0 · Published 17 Nov 2026

What it checks #

Checks the Hosted SPF (PowerSPF) record of every domain in PowerDMARC: at most 10 DNS lookups and 2 void lookups, no errors, and an -all or ~all ending. One result per domain, grouped by customer account for resellers. Reads only; changes nothing.

1 test

Install #

PowerShell
Install-MtPack weyCC81/ch.alweys.maester-pack-wey/powerdmarc

The pack also needs:

  1. A PowerDMARC Personal Access Token (API Settings > Personal Access Tokens), or for resellers an MSSP token (API Settings > Manage API Tokens).

  2. Maester installs the PowerDMARC module 0.1.1 from the PowerShell Gallery with the pack.

Maester saves PowerDMARC 0.1.1 for the pack when you install it.

Connect #

  1. End user: the domains of the token's own account.

    PowerShell
    Connect-Maester -Service WEY.POWERDMARC.Api -ServiceSetting @{ ApiToken = (Read-Host -AsSecureString 'PowerDMARC token') }
  2. Reseller (MSSP): every customer account on your portal, or one with AccountId.

    PowerShell
    Connect-Maester -Service WEY.POWERDMARC.Api -ServiceSetting @{ ApiToken = (Read-Host -AsSecureString 'PowerDMARC token'); Mode = 'Reseller'; BaseUri = 'reseller.powerdmarc.com' }

Run #

  1. Run the pack on its own.

    PowerShell
    Invoke-Maester -Pack WEY.POWERDMARC -SkipBuiltIn
Settings (3)
SettingDefaultWhat it does
MaximumLookups10The most DNS lookups the SPF record may need (1 to 10).
MaximumVoidLookups2The most lookups that may return nothing.
RequireHardFailfalseAccept only -all; by default ~all passes too.

App-only #

Runs without a signed-in user, as an app, for example in a pipeline.

CertificateClient secretManaged identityWorkload identity federation

Runs unattended with the token in the MAESTER_WEY_POWERDMARC_API_APITOKEN environment variable (and _MODE, _BASEURI, _ACCOUNTID as needed). No Microsoft sign-in is needed.

README #

PowerDMARC Maester pack

by Alweys C//oud: ensure that your cloud is always oriented the right way.

A Maester Pack that checks the email authentication PowerDMARC manages for your domains. It reads through the PowerDMARC API with the PowerDMARC PowerShell module and changes nothing.

Not made by or affiliated with PowerDMARC.

Try it

Install-MtPack weyCC81/ch.alweys.maester-pack-wey/powerdmarc

Create a Personal Access Token in PowerDMARC under API Settings > Personal Access Tokens (MSSP administrators: API Settings > Manage API Tokens), then connect and run the pack:

# End user (Default mode): the domains of the token's own account
Connect-Maester -Service WEY.POWERDMARC.Api -ServiceSetting @{ ApiToken = (Read-Host -AsSecureString 'PowerDMARC token') }

# Reseller (MSSP mode) on your portal host: one customer account, or leave AccountId out for every account
Connect-Maester -Service WEY.POWERDMARC.Api -ServiceSetting @{
    ApiToken  = (Read-Host -AsSecureString 'PowerDMARC token')
    Mode      = 'Reseller'
    BaseUri   = 'reseller.powerdmarc.com'
    AccountId = 42
}

Invoke-Maester -Pack WEY.POWERDMARC -SkipBuiltIn

For unattended runs, put the token in the MAESTER_WEY_POWERDMARC_API_APITOKEN environment variable (and ..._MODE, ..._BASEURI, ..._ACCOUNTID as needed) instead of -ServiceSetting. Keep it out of maester-config.json. Without a connection the tests are skipped.

Setting Default What it does
ApiToken (required) The Personal Access Token, as a SecureString or a string
Mode Default Default (End User API) or Reseller (MSSP API)
BaseUri app.powerdmarc.com The PowerDMARC host; resellers use their own portal host
AccountId 0 Reseller mode: the customer account to check; 0 checks every customer account

Tests

ID What it checks
MP.WEY.POWERDMARC.1001 One result per domain: the Hosted SPF (PowerSPF) record needs at most 10 DNS lookups and at most 2 void lookups, has no errors, and ends with -all or ~all. Domains without Hosted SPF are skipped

Each domain gets its own result, MP.WEY.POWERDMARC.1001.<domain>. In Reseller mode each result has the field Account, the customer account it belongs to, so the report groups and filters the domains by customer. A domain that two customer accounts hold gets the account ID at the end: MP.WEY.POWERDMARC.1001.<domain>.<account ID>.

Change the limits in your maester-config.json, for every domain or for one, or leave a domain out:

{
  "TestSettings": [
    { "Id": "MP.WEY.POWERDMARC.1001", "Parameters": { "MaximumLookups": 8, "MaximumVoidLookups": 2, "RequireHardFail": true } },
    { "Id": "MP.WEY.POWERDMARC.1001.contoso.com", "Parameters": { "RequireHardFail": false } },
    { "Id": "MP.WEY.POWERDMARC.1001.contoso.onmicrosoft.com", "Enabled": false }
  ]
}

What the pack reaches

Uses in maester-pack.json declares it, and Install-MtPack shows it before installing:

  • Service: WEY.POWERDMARC.Api, the pack's own connector (connector/Connect-WeyDmarcPowerDmarc.ps1).
  • Module: PowerDMARC 0.1.1 from the PowerShell Gallery, saved and pinned by Maester at install.
  • Network: *.powerdmarc.com, through the module. The module sends only GET requests.
  • Tenant writes and Graph scopes: none.

Develop

Check the pack and run its tests from this folder:

Test-MtPack .
Invoke-MtTest -Path .

check-pack.yml does the same on every push and pull request. Write what changed under ## Unreleased in CHANGELOG.md and raise Version in maester-pack.json.

A test is a Maester native test: see Writing native tests and Writing a pack.

Files

Path What it is
maester-pack.json The manifest: ID, code, version, the suite, helpers, the connector and what the pack uses
tests/ The suite: suite.json, and one Test.<ID>.ps1 and Test.<ID>.md per test
helpers/ Functions the tests call: Get-WEYDmarcDomain lists the domains in scope with their customer account, and Connect-WEYDmarcPowerDmarcModule connects the loaded PowerDMARC module
connector/ Connect-, Test- and Disconnect-WEYDmarcPowerDmarc for the PowerDMARC API
assets/banner.png The image the pack index shows when it features the pack

Security issues: see the security policy.

About

Made by Stefan Wey, trainer and solution engineer at Alweys C//oud, who writes there about Microsoft 365 mail security, identity and collaboration. Also by Alweys C//oud: the PowerDMARC PowerShell module this pack uses.

Install
Install-MtPack weyCC81/ch.alweys.maester-pack-wey/powerdmarc

Assumes Maester is installed. New to Maester? Get started.

Next: connect and run
Connect
Connect-Maester -Service WEY.POWERDMARC.Api -ServiceSetting @{ ApiToken = (Read-Host -AsSecureString 'PowerDMARC token') }Connect-Maester -Service WEY.POWERDMARC.Api -ServiceSetting @{ ApiToken = (Read-Host -AsSecureString 'PowerDMARC token'); Mode = 'Reseller'; BaseUri = 'reseller.powerdmarc.com' }
Run
Invoke-Maester -Pack WEY.POWERDMARC -SkipBuiltIn