New-EntraBetaCustomSecurityAttributeDefinition

创建新的 customSecurityAttributeDefinition 对象。

语法

Default (默认值)

New-EntraBetaCustomSecurityAttributeDefinition

    -IsSearchable <Boolean>
    -IsCollection <Boolean>
    -AttributeSet <String>
    -Type <String>
    -Name <String>
    -Status <String>
    -UsePreDefinedValuesOnly <Boolean>
    [-Description <String>]
    [<CommonParameters>]

说明

该 New-EntraBetaCustomSecurityAttributeDefinition cmdlet 创建新的 customSecurityAttributeDefinition 对象。 指定IsSearchable用于创建新的自定义安全属性定义的 、IsCollectionAttributeSet、Type、 NameStatus 和UsePreDefinedValuesOnly参数。

可以在租户中定义最多 500 个活动对象。

必须为已登录用户分配以下目录角色之一:

  • 属性定义管理员

示例

示例 1:添加自定义安全属性

Connect-Entra -Scopes 'CustomSecAttributeDefinition.Read.All', 'CustomSecAttributeDefinition.ReadWrite.All'
$attributeSet = Get-EntraAttributeSet -Id 'ContosoSet'
$params = @{
    Name                    = 'ProjectTest'
    Description             = 'Target completion'
    Type                    = 'String'
    Status                  = 'Available'
    AttributeSet            = $attributeSet.Id
    IsCollection            = $False
    IsSearchable            = $True
    UsePreDefinedValuesOnly = $True
}
New-EntraBetaCustomSecurityAttributeDefinition @params
Id               AttributeSet Description       IsCollection IsSearchable Name        Status    Type   UsePreDefinedValuesOnly
--               ------------ -----------       ------------ ------------ ----        ------    ----   -----------------------
Test_ProjectTest Test         Target completion False        True         ProjectTest Available String False

此示例演示如何添加自定义安全属性。

  • -Name 参数指定自定义安全属性的名称。
  • -Description 参数指定自定义安全属性的说明。
  • -Type 参数指定自定义安全属性值的数据类型。
  • -Status 参数指定自定义安全属性处于活动状态或已停用。
  • -AttributeSet 参数指定属性集的名称。
  • -IsCollection 参数指定可向自定义安全属性分配多个值。
  • -IsSearchable 参数指定自定义安全属性值的索引以搜索对象。
  • -UsePreDefinedValuesOnly 参数指定唯一的预定义值可以分配给自定义安全属性。

参数

-AttributeSet

属性集的名称。 不区分大小写。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Description

自定义安全属性的说明,最多包含 128 个字符,包括 Unicode 字符。 稍后可以更改此说明。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-IsCollection

指示是否可以将多个值分配给自定义安全属性。 以后无法更改。 如果类型设置为布尔值,则 isCollection 不能设置为 true。

参数属性

类型:System.Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-IsSearchable

指示是否为自定义安全属性值编制索引以搜索分配有属性值的对象。 以后无法更改。

参数属性

类型:System.Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Name

自定义安全属性的名称。 在属性集中必须是唯一的。 最多可包含 32 个字符,并且包含 Unicode 字符。 不能包含空格或特殊字符。 以后无法更改。 不区分大小写。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Status

指定自定义安全属性是处于活动状态还是已停用状态。 可接受的值为:可用和弃用。 稍后可以更改。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Type

自定义安全属性值的数据类型。 支持的类型包括:布尔值、整数和字符串。 以后无法更改。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-UsePreDefinedValuesOnly

指示是否只能将预定义值分配给自定义安全属性。 如果设置为 false,则允许自由格式值。 以后可以从 true 更改为 false,但不能从 false 更改为 true。 如果类型设置为布尔值,则 usePreDefinedValuesOnly 无法设置为 true。

参数属性

类型:System.Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。

输入

None

输出

System.Object