Get-EntraNamedLocationPolicy

Gets a Microsoft Entra ID named location policy.

Syntax

Get-EntraNamedLocationPolicy
   [-Property <String[]>]
   [<CommonParameters>]
Get-EntraNamedLocationPolicy
   -PolicyId <String>
   [-Property <String[]>]
   [<CommonParameters>]

Description

This cmdlet allows an admin to get the Microsoft Entra ID named location policies.

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

Examples

Example 1: Retrieves a list of all named location policies in Microsoft Entra ID

Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraNamedLocationPolicy

Id                                   CreatedDateTime      DisplayName    ModifiedDateTime
--                                   ---------------      -----------    ----------------
dddddddd-3333-4444-5555-eeeeeeeeeeee 31/07/2024 9:53:10   NamedLocation   31/07/2024 9:53:10 
eeeeeeee-4444-5555-6666-ffffffffffff 31/07/2024 4:38:42   NamedLocation1  31/07/2024 4:38:42 
ffffffff-5555-6666-7777-aaaaaaaaaaaa 01/08/2024 4:39:42   NamedLocation2  01/08/2024 4:39:42 
aaaaaaaa-6666-7777-8888-bbbbbbbbbbbb 01/08/2024 4:57:03   NamedLocation3  01/08/2024 4:57:03

This command retrieves a list of all named location policies in Microsoft Entra ID.

Example 2: Retrieves a named location policy by Id

Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraNamedLocationPolicy -PolicyId 'dddddddd-3333-4444-5555-eeeeeeeeeeee'

Id                                   CreatedDateTime      DisplayName    ModifiedDateTime
--                                   ---------------      -----------    ----------------
dddddddd-3333-4444-5555-eeeeeeeeeeee 3/1/2024 9:53:10 AM  NamedLocation  3/1/2024 9:53:10 AM

This example retrieves a specified named location policy in Microsoft Entra ID.

  • -PolicyId parameter specifies the policy Id of a 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

-Property

Specifies properties to be returned.

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