Export (0) Print
Expand All

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.

Aa706099.wedge(en-us,VS.85).gifTo 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.

Members

The IADsProperty interface inherits from IDispatch and IADs. IADsProperty also has these types of members:

Methods

The IADsProperty interface has these methods.

MethodDescription
Get

Gets the value for a property by name.

GetEx

Gets the value for a single or multi-valued property by name.

GetInfo

Loads the property values of this object from the underlying directory store.

GetInfoEx

Loads specific property values of this object from the underlying directory store.

Put

Sets the value for a property by name.

PutEx

Sets the value for a single or multi-valued property by name.

Qualifiers

Optional additional provider-specific constraints on this property.

SetInfo

Persists the changes on this object to the underlying directory store.

 

Properties

The IADsProperty interface has these properties.

PropertyAccess typeDescription

AdsPath

Read-only

Gets the object's ADsPath that uniquely identifies this object from all others.

Class

Read-only

Gets the name of the object's schema class.

GUID

Read-only

Gets the GUID of the object as stored in the underlying directory store.

MaxRange

Read/write

Upper limit of values.

MinRange

Read/write

Lower limit of values.

MultiValued

Read/write

Whether or not this is a property that supports multiple values.

Name

Read-only

Gets the object's relative name.

OID

Read/write

Directory-specific object identifier.

Parent

Read-only

Gets the ADsPath string for the parent of the object.

Schema

Read-only

Gets the ADsPath string to the schema class object for this object.

Syntax

Read/write

Relative path of the syntax object.

 

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.


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

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Iads.h

DLL

Activeds.dll

IID

IID_IADsProperty is defined as C8F93DD3-4AE0-11CF-9E73-00AA004A5691

See also

IADsClass

 

 

Show:
© 2014 Microsoft