Set-AzureADPolicy

Updates a policy.

Syntax

Set-AzureADPolicy
   -Id <String>
   [-AlternativeIdentifier <String>]
   [-Definition <System.Collections.Generic.List`1[System.String]>]
   [-DisplayName <String>]
   [-IsOrganizationDefault <Boolean>]
   [-KeyCredentials <System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.KeyCredential]>]
   [-Type <String>]
   [<CommonParameters>]

Description

The Set-AzureADPolicy cmdlet sets a policy in Azure Active Directory (AD).

Examples

Example 1: Update a policy

PS C:\>Set-AzureADPolicy -ObjectId <object id of policy> -DisplayName <string>

This command updates the specified policy in Azure AD.

Parameters

-AlternativeIdentifier

Specifies an alternative ID for the policy.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Definition

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

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisplayName

Specifies the display name.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

The Id pf the policy for which you want to set values.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-IsOrganizationDefault

True if this policy is the organisational default

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-KeyCredentials

Specifies the key credentials.

Type:System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.KeyCredential]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Type

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

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False