Directory Programming .NET

Active Directory and ADAM programming support for .NET developers
Welcome to Directory Programming .NET Sign in | Join | Help

Re: Adding an attribute to a class using c#

  •  07-07-2010, 2:10 PM

    Re: Adding an attribute to a class using c#

    It is totally possible but also is typically a terrible idea that I would never recommend. :)

    The "right" way to do such things is to package your schema extension as a standard LDIF file. That way, it can be provided to the AD admins who can add it to their AD as part of their change control process. AD admins HATE black box tools that modify their directories. LDIF files are transparent and show exactly what they are doing so they can be inspected and verified as needed.

    It is also still possible to have your installer implement this change by shelling out to LDIFDE with the file. If you do so, remember that the operation must be performed against the schema FSMO by an enterprise admin.

    If you really want to modify the schema in C#, the easiest way is to use the SDS.ActiveDirectory namespace to create a new schema object. However, you can do this via pure LDAP by simply creating the required objects in the schema container. Note that to add an attribute, you must also add the attribute to a class and update the schema.

    If you need some LDIF schema samples, the ADAM install comes with a bunch and I have a simple one from my Jan 2008 MSDN article that I can easily share.

View Complete Thread