views:

284

answers:

1

Has everyone ever programatically created a custom attribute? (At the moment I've just used the Scheme snap-in)

Ideally I want (admin) users to be able to administer an ADAM instance through a web interface. I'm writing web-services to be able to do things such as create new users but it's also been requested that custom attributes be created through a web front end as well,

anyone ever done this before or have any advice / links?

Thanks in advance

+1  A: 

Here is an example LDIF file that adds an attribute to the schema. Replace "X", attributeID, attributeSyntax, schemaIDGUID and the others with values you need to have. Programmatically you might try to send this LDIF file using LDAP, or using ADAM's command line utility ldifde (I hope I remember it's name correctly). I actually used this ldif file to import a new attribute into ADAM a few years ago...

dn: CN=Uid-Number,CN=Schema,CN=Configuration,CN=X
changetype: ntdsschemaadd
objectClass: top
objectClass: attributeSchema
cn: Uid-Number
attributeID: 1.2.840.113556.1.4.302.1.2.3.4.5.6.7
attributeSyntax: 2.5.5.9
isSingleValued: TRUE
rangeLower: 1
rangeUpper: 100000
showInAdvancedViewOnly: TRUE
adminDisplayName: Uid-Number
adminDescription: Uid-Number
instanceType: 4
oMSyntax: 2
searchFlags: 0
lDAPDisplayName: uidNumber
schemaIDGUID:: MnqWv+YM0BGihQCqADBJ4g==
systemOnly: FALSE

Don't forget that Active Directory only allows to add new schema entries, and you cannot delete them. I think this holds to ADAM too, so be careful when adding new entries.

SztupY