Commands › Exchange Online

Add-IPBlockListEntry

Exchange Online ExchangeOnlineManagement Add-*

This cmdlet is available or effective only on Edge Transport servers in on-premises Exchange. Use the Add-IPBlockListEntry cmdlet to add IP Block list entries to the IP Block list that's used by the Connection Filtering agent on Edge Transport servers.

Quick start script

# Add-IPBlockListEntry — 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
Add-IPBlockListEntry -IPAddress <IPAddress> -IPRange <IPRange> | Format-List

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

Syntax — 2 parameter sets

IPAddress

Add-IPBlockListEntry -IPAddress <IPAddress>
 [-Comment <String>]
 [-Confirm]
 [-ExpirationTime <DateTime>]
 [-Server <ServerIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

IPRange

Add-IPBlockListEntry -IPRange <IPRange>
 [-Comment <String>]
 [-Confirm]
 [-ExpirationTime <DateTime>]
 [-Server <ServerIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (7)

ParameterTypeRequiredWhat it controls
-IPAddress IPAddress yes The IPAddress parameter specifies a single IP address to add to the IP Block list, for example, 192.168.0.1.
-IPRange IPRange yes The IPRange parameter specifies a range of IP addresses to add to the IP Block list. Valid values are:
-Comment String The Comment parameter specifies an optional comment. If you specify a value that contains spaces, enclose the value in quotation marks ("), for example: "This is an admin note".
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-ExpirationTime DateTime The ExpirationTime parameter specifies a day and time when the IP Block list entry expires. If you specify a time only and you don't specify a date, the current day is assumed.
-Server ServerIdParameter The Server parameter specifies the Exchange server where you want to run this command. You can use any value that uniquely identifies the server. For example:
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. 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.