IADsProperty interface

The IADsProperty interface is designed to manage a single attribute definition for a schema class object. An attribute definition specifies the minimum and maximum values of a property, its syntax, and whether the property supports multiple values. Other interfaces involved in schema management include IADsClass and IADsSyntax.

The IADsProperty interface exposes methods to describe a property by name, syntax, value ranges, and any other defined attributes. A property can have multiple names associated with it, but providers must ensure that each name is unique.

Use the IADsProperty interface to determine at run time the attribute definition of a property supported by a directory service object.

To determine the attribute definition at run time

  1. Bind to the schema class object of the ADSI object.
  2. Enumerate mandatory or optional attributes accessible from the schema class object. Skip this step if you know that the object supports the attribute of your interest.
  3. Bind to the schema container of the schema class object you obtained in first step.
  4. Retrieve the attribute definition object of the property of interest from the schema container.
  5. Examine the attribute definition of the property. You may have to also inspect the syntax object.

Methods

The IADsProperty interface has these methods.

Method Description
IADsProperty::Qualifiers Returns a collection of ADSI objects that describe additional qualifiers of this property.

Remarks

The IADsProperty interface methods can add new attributes and property objects to a provider-specific implementation.

Examples

The following code example shows the procedure above for applying the IADsProperty interface to determine attribute definitions of a property.

VB
Dim obj As IADs
Dim cl As IADsClass
Dim pr As IADsProperty
Dim sy As IADsSyntax
Dim sc As IADsContainer

On Error GoTo Cleanup

' Step 1 Set obj = GetObject("WinNT://myMachine,computer") Set cl = GetObject(obj.Schema)

' Step 2 ' Skip it, assuming the "Owner" attribute is supported by obj. ' For the computer object in this example, it is indeed one of ' the supported optional properties.

' Step 3 Set sc = GetObject(cl.Parent)

' Step 4 Set pr = sc.GetObject("Property","Owner")

' Step 5 MsgBox "Attribute: " & pr.Name MsgBox "Syntax: " & pr.Syntax If pr.Multivalued = True Then MsgBox "The Owner attribute has multiple values." Else MsgBox "The Owner attribute has a single value." End If

' To further examine the syntax Set sy = GetObject(sc.AdsPath & "/" & pr.Syntax) MsgBox "Syntax object: " & sy.Name & " of OleAutoDataType: " _ & sy.OleAutoDataType

Cleanup: If (Err.Number <> 0 ) Then MsgBox("An error has occurred. " & Err.Number) End If

Set obj = Nothing
Set cl = Nothing
Set pr = Nothing
Set sy = Nothing
Set sc = Nothing</pre>

Requirements

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header iads.h

See Also

IADs

IADsClass

IDispatch