New-AzureADPolicy

Creates a policy.

Syntax

New-AzureADPolicy
   [-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 New-AzureADPolicy cmdlet creates a policy in Azure Active Directory (AD).

Examples

Example 1: Create a policy

PS C:\>New-AzureADPolicy -Definition <Array of Rules> -DisplayName <Name of Policy> -IsTenantDefault

This command creates a new policy.

Parameters

-AlternativeIdentifier

Specifies an alternative ID.

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

-Definition

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

Type:List<T>[String]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

String of the policy name

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

-IsOrganizationDefault

True if this policy is the organisational default

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

-KeyCredentials

Type:List<T>[Microsoft.Open.MSGraph.Model.KeyCredential]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Type

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

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