共用方式為


New-AzureADPolicy

建立原則。

語法

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

New-AzureADPolicy Cmdlet 會在 Azure Active Directory (AD) 中建立原則。

範例

範例 1:建立原則

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

此命令會建立新的原則。

參數

-AlternativeIdentifier

指定替代識別碼。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Definition

指定 JSON 陣列,其中包含原則的所有規則,例如: -Definition @ (“{”TokenLifetimePolicy“:{”Version“:1,”MaxInactiveTime“:”20:00:00“}}”)

類型:List<T>[String]
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-DisplayName

原則名稱的字串

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-IsOrganizationDefault

如果此原則是組織預設值,則為 True

類型:Boolean
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-KeyCredentials

類型:List<T>[Microsoft.Open.MSGraph.Model.KeyCredential]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Type

指定原則的類型。 針對令牌存留期,指定 「TokenLifetimePolicy」。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False