Share via


PowerShell Script to Check if Domains are Verified Using PowerShell


PowerShell Script to Check if Domains are Verified Using PowerShell


Summary

This TechNet Wiki is based on the TechNet Forum Post -

Requirement

Need a PowerShell script to idenitify Domain verification status in Office365

Help

We need to go through the below help contents

help Get-AcceptedDomain -Detailed

help Get-MsolDomain -Detailed

help about_Pipelines -Detailed

help about_Aliases -Detailed

help Where-Object -Detailed

Solution

Connect to Exchange Online

Import-Module MSOnline
$O365Cred = Get-Credential
$O365Session = New-PSSession â€“ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxymethod=rps -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session
Connect-MsolService â€“Credential $O365Cred

Query Verified Domain

Get-MsolDomain | ? {$_.Status -eq 'Verified'}

Result