Изменить

Поделиться через


Remove-EntraNamedLocationPolicy

Deletes a Microsoft Entra ID named location policy by PolicyId.

Syntax

Remove-EntraNamedLocationPolicy
      -PolicyId <String>
      [<CommonParameters>]

Description

This cmdlet allows an admin to delete the Microsoft Entra ID named location policy.

Named locations are custom rules that define network locations, which can then be used in a Conditional Access policy.

In delegated scenarios with work or school accounts, when acting on another user, the signed-in user must have a supported Microsoft Entra role or custom role with the required permissions. Supported roles include:

  • Security Administrator
  • Conditional Access Administrator

Examples

Example 1: Deletes a named location policy in Microsoft Entra ID

Connect-Entra -Scopes 'Policy.ReadWrite.ConditionalAccess', 'Policy.Read.All'
$policy = Get-EntraNamedLocationPolicy | Where-Object { $_.DisplayName -eq 'IP named location policy' }
Remove-EntraNamedLocationPolicy -PolicyId $policy.Id

This command demonstrates how to delete the named location policy in Microsoft Entra ID.

  • -PolicyId parameter specifies the Id of named location policy.

Parameters

-PolicyId

Specifies the ID of a named location policy in Microsoft Entra ID.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False