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.
Examples
Example 1: Deletes a named location policy in Microsoft Entra ID
Connect-Entra -Scopes 'Policy.ReadWrite.ConditionalAccess'
$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 |