Commands › Exchange Online

Get-TenantAllowBlockListItems

Exchange Online ExchangeOnlineManagement Get-*

View entries in the Tenant Allow/Block List in the Microsoft Defender portal.

Quick start script

# Get-TenantAllowBlockListItems — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Get-TenantAllowBlockListItems -ListType <ListType> -NoExpiration <SwitchParameter> | Format-List

# 3. Export for evidence / drift tracking
Get-TenantAllowBlockListItems | Export-Clixml .\TenantAllowBlockListItems-$(Get-Date -Format yyyyMMdd).xml

Syntax — 2 parameter sets

Expiration (Default)

Get-TenantAllowBlockListItems -ListType <ListType> [-ExpirationDate <DateTime>]
 [-Allow]
 [-Block]
 [-Entry <String>]
 [-ListSubType <ListSubType[]>]
 [-OutputJson]
 [<CommonParameters>]

NoExpiration

Get-TenantAllowBlockListItems -ListType <ListType> [-NoExpiration]
 [-Allow]
 [-Block]
 [-Entry <String>]
 [-ListSubType <ListSubType[]>]
 [-OutputJson]
 [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-ListType ListType yes The ListType parameter specifies the list to view. Valid values are:
-Entry String The Entry parameter filters the results based on the ListType parameter value. Valid values are:
-NoExpiration SwitchParameter yes The NoExpiration switch filters the results by entries that are set to never expire. You don't need to specify a value with this switch.
-Allow SwitchParameter The Allow switch filters the results for allow entries. You don't need to specify a value with this switch.
-Block SwitchParameter The Block switch filters the results for block entries. You don't need to specify a value with this switch.
-ExpirationDate DateTime The ExpirationDate parameter filters the results by expiration date in Coordinated Universal Time (UTC).
-ListSubType ListSubType[] The ListSubType parameter filters the results by subtype. Valid values are:
-OutputJson SwitchParameter The OutputJson switch specifies whether to return all entries in a single JSON value. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.