Microsoft’s Cloud Solution Provider (CSP) uses a CSP portal to access clients’ tenants. This script will fetch the tenant IDs through the CSP credentials. Then it will extract details of all the verified domains within each tenant. Lastly, it will check DKIM, DMARC and SPF txt record details of the tenant’s verified domains and create a get_result.txt file that contains all the details within the same folder.
Syntax
$ErrorActionPreference= ‘silentlycontinue’
Install-Module PartnerCenter
Install-Module MSOnline
Install-Module AzureAD
Connect-MsolService
$tenant = Get-MsolPartnerContract -All | Select-Object TenantId
‘there are ‘ + $tenant.Count + ‘ tenant’
$d = 0
$Result = foreach ($ids in $tenant.TenantId) {
The .txt file will display record names as below:
DKIM Selector 1 CNAME Record
DKIM Selector 2 CNAME Record
DMARC TXT Record
SPF TXT Record
Purpose: | The purpose of this script is to check whether DKIM/DMARC/SPF records are created for each of the tenant's verified domains |
Modification: | - |
Type: | PowerShell Script (ps1) |
Compatibility: | Windows |
Tags: | None |
Reference link: | Quickly Check and Manage your Exchange Online DNS Records for SPF, DKIM and DMARC with PowerShell |