Edit

Share via


New-EntraBetaCustomSecurityAttributeDefinition

Create a new customSecurityAttributeDefinition object.

Syntax

Default (Default)

New-EntraBetaCustomSecurityAttributeDefinition

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

Description

The New-EntraBetaCustomSecurityAttributeDefinition cmdlet creates a new customSecurityAttributeDefinition object. Specify IsSearchable, IsCollection, AttributeSet, Type, Name, Status and UsePreDefinedValuesOnly parameters for create a new custom security attribute definition.

You can define up to 500 active objects in a tenant.

The signed-in user must be assigned one of the following directory roles:

  • Attribute Definition Administrator

Examples

Example 1: Add a custom security attribute

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

This example demonstrates how to add a custom security attribute.

  • -Name parameter specifies the name of the custom security attribute.
  • -Description parameter specifies the description of the custom security attribute.
  • -Type parameter specifies the data type for the custom security attribute values.
  • -Status parameter specifies the custom security attribute is active or deactivated.
  • -AttributeSet parameter specifies the name of attribute set.
  • -IsCollection parameter specifies the allows multiple values can be assigned to the custom security attribute.
  • -IsSearchable parameter specifies the custom security attribute values are indexed for searching on objects.
  • -UsePreDefinedValuesOnly parameter specifies the only predefined values can be assigned to the custom security attribute.

Parameters

-AttributeSet

Name of the attribute set. Case insensitive.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Description of the custom security attribute, up to 128 characters long and including Unicode characters. This description can be changed later.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsCollection

Indicates whether multiple values can be assigned to the custom security attribute. Can't be changed later. If type is set to Boolean, isCollection can't be set to true.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsSearchable

Indicates whether custom security attribute values are indexed for searching on objects that are assigned attribute values. Can't be changed later.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Name of the custom security attribute. Must be unique within an attribute set. Can be up to 32 characters long and include Unicode characters. Can't contain spaces or special characters. Can't be changed later. Case insensitive.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Status

Specifies whether the custom security attribute is active or deactivated. Acceptable values are: Available and Deprecated. Can be changed later.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Type

Data type for the custom security attribute values. Supported types are: Boolean, Integer, and String. Can't be changed later.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UsePreDefinedValuesOnly

Indicates whether only predefined values can be assigned to the custom security attribute. If set to false, free-form values are allowed. Can later be changed from true to false, but can't be changed from false to true. If type is set to Boolean, usePreDefinedValuesOnly can't be set to true.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object