trying to create a new schema attribute via adsi/asp

trying to create a new schema attribute via adsi/asp

Post by Areen Satta » Wed, 01 May 2002 09:40:52

Hi all,

I'd really appreciate it if someone could give me a hand here. I'm trying to
create a new attribute on the active directory schema. I believe the code is
correct and I've added a registry entry for Schema Updates. I've also
checked the Schema Admins group and it appears that the domain admin is in
there. I get  the following message when I execute SetInfo:
error '80072035'
The server is unwilling to process the request.

Can anyone tell me what might be causing this?? Just for kicks, I've
incluede my code for creating the attribute below....



set adsSchemaContainer = GetObject("LDAP://cn=Schema, cn=Configuration,
DC=affidia-dev, DC=local") Response.Write "got schema container"

set adsAttribute =

adsAttribute.Put "cn", "Affidia-Postal-City"

adsAttribute.Put "attributeId", "1.2.840.113556.1.1.1"  <- i figured this
out based on the OID of the domain???

adsAttribute.Put "oMSyntax", 20

adsAttribute.Put "attributeSyntax", ""

adsAttribute.Put "isSingleValued", True

adsAttribute.Put "lDAPDisplayName", "postalCity"

adsAttribute.SetInfo Response.Write "set mandatory attributes"


adsAttribute.Description = "Contains the city from the user's address"

adsAttribute.Put "rangeLower", 1

adsAttribute.Put "rangeUpper", 75

adsAttribute.Put "searchFlags", True


Response.Write "set optional attributes"


1. Problem: LDAP query via ADSI from ASP (no schema)


I'm a newbie, and I hope this doesn't sound like a silly question...

I am trying to parse the results of an LDAP query in order to retrieve
(and confirm) a single attribute. The LDAP server is running OpenLDAP,
which (in its current implementation) doesn't appear to make its schema
accessible to remote clients.

Although I have managed to sift through enough examples to bind and
enumerate all of the DNs (via a 'Select *' query), I am stumped because
I can't figure out how to specify the attribute type -- and so I am
receiving an error when I use a query like: 'Select area, timezone'...

The error is:

0x8000500C - "The Active Directory datatype cannot be converted to/from
a native DS datatype"

According to the documentation in the Platform SDK:


<== BEGIN ==>

ADSI normally loads schema information if your directory supports a
schema, as Active Directory does. Since ADSI knows the syntax of
attributes in the schema, you don't need to specify the attribute type
when accessing it. ADSI does the hard work for you by marshaling
attribute values to the appropriate data type as defined in the schema.

If your directory has no schema, you must supply the data type when
you're accessing an attribute.
<== END ==>

Unfortunately, I can't find an example of supplying '<I>the data type
when you're accessing an attribute</I>'.

Can anyone provide a quick sample (in VBScript) of how I would query
and parse a LDAP DB where the schema is not available?



Sent via
Before you buy.

2. FP Save Results Component - but different!

3. create user w/ ADSI via ASP

4. Inquirer: Compaq white paper gives rationale for June 25 decision

5. ADSI Anymous User Create New Local NT Account in ASP

6. WTB: 32MB/64MB FOR SS4

7. Creating new users in ADSI/ASP

8. Domino R5 on AS/400

9. ADSI Schema Attributes

10. Schema attributes of AD are missing in .NET beta3 using ADSI

11. retrieving extended schema attributes using ADSI

12. accessing new attributes in user schema

13. How Add Schema Attribute to Schema Class?