Directory Services


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 in Vtable Order

The IADsProperty interface inherits the methods of the standard COM interfaces:

In addition, IADsProperty defines the following methods.

Method Description
get_OID Directory-specific object identifier.
put_OID Directory-specific object identifier.
get_Syntax Relative path of the syntax object.
put_Syntax Relative path of the syntax object.
get_MaxRange Upper limit of values.
put_MaxRange Upper limit of values.
get_MinRange Lower limit of values.
put_MinRange Lower limit of values.
get_MultiValued Whether or not this is a property that supports multiple values.
put_MultiValued Whether or not this is a property that supports multiple values.
Qualifiers Optional additional provider-specific constraints on this property.


The IADsProperty interface defines the following properties. The preceding table includes access methods for these properties.

Property Description
MaxRange Upper limit of values.
MinRange Lower limit of values.
MultiValued Whether or not this is a property that supports multiple values.
OID Directory-specific object identifier.
Syntax Relative path of the syntax object.


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

Example Code [Visual Basic]

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."
	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

	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


Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also