How Add Schema Attribute to Schema Class?

How Add Schema Attribute to Schema Class?

Post by myki » Wed, 23 Jan 2002 20:31:10



How Add Schema Attribute to Schema Class?
What is the Problem follow code?  this was not able to add a schema
attribute ....
////////////////////////////////////////////////////////////////////////////
//////////////

IADsClass *padsClass = NULL;
HRESULT hr = ADsGetObject(L"LDAP://schema/user",
                  IID_IADsClass,
                  (void**)&padsClass);

hr = padsClass->put_OptionalProperties(_variant_t(
L"ncstRankGroupPath1" ) );
////////////////////////////////////////////////////////////////////////////
////////////////////////////
of course,  "ncstRankGroupPath1" is a new Schema Attribute before time.

please help me.....

 
 
 

How Add Schema Attribute to Schema Class?

Post by Jamie Vachon [MVP » Thu, 24 Jan 2002 01:38:17


You should not directly extend the user class. You should create
an auxiliary class and attach it to the user class. The ADSI SDK help file
discusses this. http://www.microsoft.com/adsi

--
--------------------------------------------------------
Jamie M. Vachon
[MVP]
--------------------------------------------------------

Quote:> How Add Schema Attribute to Schema Class?
> What is the Problem follow code?  this was not able to add a schema
> attribute ....

////////////////////////////////////////////////////////////////////////////
Quote:> //////////////

> IADsClass *padsClass = NULL;
> HRESULT hr = ADsGetObject(L"LDAP://schema/user",
>                   IID_IADsClass,
>                   (void**)&padsClass);

> hr = padsClass->put_OptionalProperties(_variant_t(
> L"ncstRankGroupPath1" ) );

////////////////////////////////////////////////////////////////////////////
Quote:> ////////////////////////////
> of course,  "ncstRankGroupPath1" is a new Schema Attribute before time.

> please help me.....


 
 
 

How Add Schema Attribute to Schema Class?

Post by myki » Thu, 24 Jan 2002 15:24:39


" You should not directly extend the user class.
You should create an auxiliary class and attach it to the user class "
from newsgroup...

so, changed code like these..
////////////////////////////////////////////////////////////////////////////
 IADsClass *padsClass = NULL;
 HRESULT hr = ADsGetObject(L" LDAP://schema/user ",
                   IID_IADsClass,
                   (void**)&padsClass);

 hr = padsClass->put_AuxDerivedFrom(_variant_t( L"samDomain" ) );

////////////////////////////////////////////////////////////////////////////
// samDomain is a AuxDerived schema class

but, is not able to change "user" schema class..

any other problem?



> You should not directly extend the user class. You should create
> an auxiliary class and attach it to the user class. The ADSI SDK help file
> discusses this. http://www.microsoft.com/adsi

> --
> --------------------------------------------------------
> Jamie M. Vachon
> [MVP]
> --------------------------------------------------------


> > How Add Schema Attribute to Schema Class?
> > What is the Problem follow code?  this was not able to add a schema
> > attribute ....

////////////////////////////////////////////////////////////////////////////
Quote:> > //////////////

> > IADsClass *padsClass = NULL;
> > HRESULT hr = ADsGetObject(L"LDAP://schema/user",
> >                   IID_IADsClass,
> >                   (void**)&padsClass);

> > hr = padsClass->put_OptionalProperties(_variant_t(
> > L"ncstRankGroupPath1" ) );

////////////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:> > ////////////////////////////
> > of course,  "ncstRankGroupPath1" is a new Schema Attribute before time.

> > please help me.....

 
 
 

1. list of al the possible attributes of the class user in the schema

hi

I'm looking for a way to query all the possible user-class attributes in the
schema. I want to become a list that is a bit look-a-like on 'the active
directory scheme mmc plugin'

is there any adsi script available for doing this? you can ask all the
possible attributes from the schema by following code, but you can't query
the description with this.

Dim obj
Set obj = GetObject("LDAP://CN=administrator,DC=sesamstraat,DC=be")
Set cls = GetObject(obj.Schema)

' Inspecting mandatory and optional properties.
msgbox  "Must-have:"
For Each p In cls.MandatoryProperties
    msgbox  p
Next
msgbox "May-have:'
For Each p In cls.OptionalProperties
    msgbox p
Next

thanks in advance,

bert claerhout

2. REVIEW: Amiga 3000T

3. Error while adding a class to AD Schema

4. use FP nav structure to generate "you are here" nav bar?

5. Schema security issues - how to verify a schema bind

6. Qnx and CORBA

7. xsd schema or xdr schema

8. Counting Records(?) In A Sequential File

9. Ad Class Schema - Server Unwilling To Perform

10. Delete AD Class Schema

11. Export Schema object "Class-Group" !!!

12. Object (schema) classes of "other" folders in AD?

13. accessing new attributes in user schema