Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Get-EntraBetaPolicy

Gets a policy.

Syntax

GetQuery (Default)

Get-EntraBetaPolicy

 [-Top <Int32>]
 [-All]
 [<CommonParameters>]

GetById

Get-EntraBetaPolicy

 -Id <String>
 [-All]
 [<CommonParameters>]

Description

The Get-EntraBetaPolicy cmdlet gets a policy in Microsoft Entra ID. Specify Id parameter to get a specific policy.

Examples

Example 1: Get all policies

Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraBetaPolicy
Definition DeletedDateTime Description DisplayName Id
---------- --------------- ----------- ----------- --
{{"activityBasedTimeoutPolicies":{"AlternateLoginIDLookup":true, "IncludedUserIds":["UserID"]}}} Activepolicy bbbbbbbb-1111-2222-3333-cccccccccccc
{{"HomeRealmDiscoveryPolicy":{"AlternateLoginIDLookup":true, "IncludedUserIds":["UserID"]}}} PolicyDemo aaaaaaaa-1111-1111-1111-000000000000

This example shows how to return all policies.

Example 2: Get policy using Display Name

Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraBetaPolicy | Where-Object {$_.DisplayName -eq 'Microsoft User Default Recommended Policy'}
DeletedDateTime Description DisplayName Id
--------------- ----------- ----------- --
 Permissions consentable based on Microsoft's current recommendations. Microsoft User Default Recommended Policy microsoft-user-default-recommended

This example shows how to get a specific policy using Display Name.

Example 3: Get a policy with specific ID

Connect-Entra -Scopes 'Policy.Read.All'
$policy = Get-EntraBetaPolicy | Where-Object {$_.DisplayName -eq 'Microsoft User Default Recommended Policy'}
Get-EntraBetaPolicy -Id $policy.Id
Id Description DisplayName Feature IsAppliedToOrganization IsEnabled
-- ----------- ----------- ------- ----------------------- ---------
bbbbbbbb-1111-2222-3333-cccccccccccc passwordHashSync rollout policy passwordHashSync rollout policy passwordHashSync False True

This example demonstrated how to receive policy with specific ID.

  • Id parameter specifies the unique policy ID, which you want to receive. In this example, bbbbbbbb-1111-2222-3333-cccccccccccc represents the ID of the policy.

Example 4: Get all policies

Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraBetaPolicy -All
Definition DeletedDateTime Description DisplayName Id
---------- --------------- ----------- ----------- --
{{"activityBasedTimeoutPolicies":{"AlternateLoginIDLookup":true, "IncludedUserIds":["UserID"]}}} Activepolicy bbbbbbbb-1111-2222-3333-cccccccccccc
{{"HomeRealmDiscoveryPolicy":{"AlternateLoginIDLookup":true, "IncludedUserIds":["UserID"]}}} PolicyDemo aaaaaaaa-1111-1111-1111-000000000000

This example demonstrates how to retrieve all policies in Microsoft Entra ID.

Example 5: Get the top one policy

Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraBetaPolicy -Top 1
Id Description DisplayName Feature IsAppliedToOrganization IsEnabled
-- ----------- ----------- ------- ----------------------- ---------
bbbbbbbb-1111-2222-3333-cccccccccccc passwordHashSync rollout policy passwordHashSync rollout policy passwordHashSync False True

This example demonstrates how to retrieve top one policies in Microsoft Entra ID. You can use -Limit as an alias for -Top.

Parameters

-All

List all policies.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

-Id

The Id of the policy you want to retrieve.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Top

Specifies the maximum number of records to return.

Parameter properties

Type:System.Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Limit

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Related Links


Feedback

Was this page helpful?