您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

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
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:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisplayName

String of the policy name

Type:String
Position:Named
Default value:None
Accept pipeline input:False
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
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, specify "TokenLifetimePolicy".

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