Note

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

Access to this page requires authorization. You can try .

Set-EntraBetaPolicy

Updates a policy.

Syntax

Default (Default)

Set-EntraBetaPolicy

 -Id <String>
 [-Definition <System.Collections.Generic.List`1[System.String]>]
 [-DisplayName <String>]
 [-Type <String>]
 [-IsOrganizationDefault <Boolean>]
 [<CommonParameters>]

Description

The Set-EntraBetaPolicy cmdlet sets a policy in Microsoft Entra ID. Specify Id parameter to updates specific policy.

Examples

Example 1: Update a policy display name

Connect-Entra -Scopes 'Policy.ReadWrite.ApplicationConfiguration'
$policy = Get-EntraBetaPolicy | Where-Object { $_.DisplayName -eq 'Microsoft User Default Recommended Policy' }
Set-EntraBetaPolicy -Id $policy.Id -DisplayName 'NewUpdated'

This command updates display name of the specified policy in Microsoft Entra ID.

  • -Id specifies the ID of the policy for which you want to set values.
  • DisplayName specifies the display name.

Example 2: Update a policy definition

Connect-Entra -Scopes 'Policy.ReadWrite.ApplicationConfiguration'
$policy = Get-EntraBetaPolicy | Where-Object { $_.DisplayName -eq 'Microsoft User Default Recommended Policy' }
$definition = @('{"activityBasedTimeoutPolicies":{"AlternateLoginIDLookup":true, "IncludedUserIds":["UserID"]}}')
Set-EntraBetaPolicy -Id $policy.Id -Definition $definition

This command updates definition of the specified policy in Microsoft Entra ID.

  • -Id specifies the ID of the policy for which you want to set values.
  • Definition specifies the array of stringified JSON that contains all the rules of the policy. In this example, @('{"activityBasedTimeoutPolicies":{"AlternateLoginIDLookup":true, "IncludedUserIds":["UserID"]}}') represents definition of the activityBasedTimeoutPolicy.

Example 3: Update a policy organization default

Connect-Entra -Scopes 'Policy.ReadWrite.ApplicationConfiguration'
$policy = Get-EntraBetaPolicy | Where-Object { $_.DisplayName -eq 'Microsoft User Default Recommended Policy' }
Set-EntraBetaPolicy -Id $policy.Id -IsOrganizationDefault $false

This command updates organization default of the specified policy in Microsoft Entra ID.

  • -Id specifies the ID of the policy for which you want to set values.
  • -IsOrganizationDefault If true, activates this policy. Only one policy of the same type can be the organization default. Optional, default is false.

Example 4: Update policy type

Connect-Entra -Scopes 'Policy.ReadWrite.ApplicationConfiguration'
$policy = Get-EntraBetaPolicy | Where-Object { $_.DisplayName -eq 'Microsoft User Default Recommended Policy' }
Set-EntraBetaPolicy -Id $policy.Id -Type 'ActivityBasedTimeoutPolicy'

This example demonstrates how to update the type property of a specified policy in Microsoft Entra ID.

  • -Id specifies the ID of the policy for which you want to set values.
  • -Type specifies the type of policy. In this example, ActivityBasedTimeoutPolicy represents the type of policy.

Parameters

-Definition

Specifies the array of stringified JSON that contains all the rules of the policy. For example -Definition @('{"TokenLifetimePolicy":{"Version":1,"MaxInactiveTime":"20:00:00"}}').

Parameter properties

Type:

System.Collections.Generic.List`1[System.String]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-DisplayName

Specifies the display name.

Parameter properties

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

Parameter sets

-Id

The ID of the policy for which you want to set values.

Parameter properties

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

Parameter sets

-IsOrganizationDefault

True if this policy is the organizational default.

Parameter properties

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

Parameter sets

-Type

Specifies the type of policy. For token lifetimes, use "TokenLifetimePolicy."

Parameter properties

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

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?