Adding new attributes to Active Directory schema

Open command line on the DC, then register the following DLL:

regsvr32 schmmgmt.dll

Open mmc and add the schema editor snap-in



Right click on "Attributes" and choose "Create Attribute...".
If this option is greyed out, make sure the user is a member of the "Schema Admins" group and that this DC is the FSMO, which should be a single in the forest.





Set the values:
* Common Name is the name of the object
* LDAP Display Name is the name by which the object is searched programmatically.
* Unique X500 Object ID - each object in AD should have a unique oid, generate it with the following PowerShell script:

$Prefix="1.2.840.113556.1.8000.2554" 
$GUID=[System.Guid]::NewGuid().ToString() 
$Parts=@() 
$Parts+=[UInt64]::Parse($guid.SubString(0,4),"AllowHexSpecifier") 
$Parts+=[UInt64]::Parse($guid.SubString(4,4),"AllowHexSpecifier") 
$Parts+=[UInt64]::Parse($guid.SubString(9,4),"AllowHexSpecifier") 
$Parts+=[UInt64]::Parse($guid.SubString(14,4),"AllowHexSpecifier")
$Parts+=[UInt64]::Parse($guid.SubString(19,4),"AllowHexSpecifier")
$Parts+=[UInt64]::Parse($guid.SubString(24,6),"AllowHexSpecifier")
$Parts+=[UInt64]::Parse($guid.SubString(30,6),"AllowHexSpecifier")
$OID=[String]::Format("{0}.{1}.{2}.{3}.{4}.{5}.{6}.{7}",$prefix,$Parts[0],$Parts[1],$Parts[2],$Parts[3],$Parts[4],$Parts[5],$Parts[6]) 
$oid 

Choose the syntax, for instance a unicode string and specify the range where appropriate.

Right click on the object you would like to extend and select properties:



Add desired attributes to the object.

You may have to logout and login again in order to see the updates in the schema.

Post a Comment

Previous Post Next Post