< Back
New-ADSchemaAttribute
Post
NAME New-ADSchemaAttribute
SYNOPSIS
Create a new attribute in the Active Directory Schema
SYNTAX
New-ADSchemaAttribute -Name <String> -Description <String> [-IsSingleValued <Boolean>] -AttributeType <String>
[-AttributeID <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-ADSchemaAttribute [-SchemaAttributeHashTable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
New-ADSchemaAttribute will add a new attribute to the AD Schema. Once the new attribute
is created, you will need to add it to a class. AD Schema best practices suggest
that you:
1) Create a new Auxiliary Class.
2) Add your attribute to that class.
3) Add your Auxiliary Class (containing your new Attribute) to an Existing Class.
See help about_ADSchema for more details
PARAMETERS
-Name <String>
The name of the attribute you are creating. This will be the CN and the LDAP
Display Name. Using a standard prefix is a good practice to follow.
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Description <String>
The Administrator description is a short description that is added as metadata to the
attribute. Should not be much more than 3 or 4 words.
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-IsSingleValued <Boolean>
Determine whether the new attribute can hold one value or an array of values.
Required? false
Position? named
Default value True
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-AttributeType <String>
Determines what type of attribute you are creating. Use a DN to create an attribute
that will hold a reference to another object in Active Directory. One example of an
existing DN attribute is a user's manager, or a group's "ManagedBy" attribute.
Strings are case-insenstive.
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-AttributeID <String>
AttributeID is the Object Identifier (OID) for the new attribute. OIDs have a
specific syntax that looks something like '1.2.840.113556.1.8000.2554.13769.13577.20614'
You can use the New-ADSchemaTestOid to generate one. However, in production, you should
use your own OID based on your company's defined OID structure and your Private Enterprise
Number. For more inforation, please look at help about_ADSchema.
Required? false
Position? named
Default value (New-ADSchemaTestOID)
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-SchemaAttributeHashTable <String>
This parameter is the rope that will let you hang yourself if you are not careful. It is
for advanced users that want to generate highly customized attributes. Any of the attributes
found in https://technet.microsoft.com/en-us/lib ... 61746.aspx could be used.
You will need to store them in a hashtable with their corresponding values. Using a custom
hashtable, you can specify any of the attributes in attributeSchema objects and use any
attributeSyntax you want.
Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$oid = New-ADSchemaTestOID
New-ADSchemaAttribute -Name as-favoriteColor -Description 'Favorite Color' -IsSingleValued $true -AttributeType
String -AtributeID $oid
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$hash - Get-ADSchemaClass com*
RELATED LINKS
SYNOPSIS
Create a new attribute in the Active Directory Schema
SYNTAX
New-ADSchemaAttribute -Name <String> -Description <String> [-IsSingleValued <Boolean>] -AttributeType <String>
[-AttributeID <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-ADSchemaAttribute [-SchemaAttributeHashTable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
New-ADSchemaAttribute will add a new attribute to the AD Schema. Once the new attribute
is created, you will need to add it to a class. AD Schema best practices suggest
that you:
1) Create a new Auxiliary Class.
2) Add your attribute to that class.
3) Add your Auxiliary Class (containing your new Attribute) to an Existing Class.
See help about_ADSchema for more details
PARAMETERS
-Name <String>
The name of the attribute you are creating. This will be the CN and the LDAP
Display Name. Using a standard prefix is a good practice to follow.
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Description <String>
The Administrator description is a short description that is added as metadata to the
attribute. Should not be much more than 3 or 4 words.
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-IsSingleValued <Boolean>
Determine whether the new attribute can hold one value or an array of values.
Required? false
Position? named
Default value True
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-AttributeType <String>
Determines what type of attribute you are creating. Use a DN to create an attribute
that will hold a reference to another object in Active Directory. One example of an
existing DN attribute is a user's manager, or a group's "ManagedBy" attribute.
Strings are case-insenstive.
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-AttributeID <String>
AttributeID is the Object Identifier (OID) for the new attribute. OIDs have a
specific syntax that looks something like '1.2.840.113556.1.8000.2554.13769.13577.20614'
You can use the New-ADSchemaTestOid to generate one. However, in production, you should
use your own OID based on your company's defined OID structure and your Private Enterprise
Number. For more inforation, please look at help about_ADSchema.
Required? false
Position? named
Default value (New-ADSchemaTestOID)
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-SchemaAttributeHashTable <String>
This parameter is the rope that will let you hang yourself if you are not careful. It is
for advanced users that want to generate highly customized attributes. Any of the attributes
found in https://technet.microsoft.com/en-us/lib ... 61746.aspx could be used.
You will need to store them in a hashtable with their corresponding values. Using a custom
hashtable, you can specify any of the attributes in attributeSchema objects and use any
attributeSyntax you want.
Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$oid = New-ADSchemaTestOID
New-ADSchemaAttribute -Name as-favoriteColor -Description 'Favorite Color' -IsSingleValued $true -AttributeType
String -AtributeID $oid
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$hash - Get-ADSchemaClass com*
RELATED LINKS