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
- Bind to the schema class object of the ADSI object.
- 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.
- Bind to the schema container of the schema class object you obtained in first step.
- Retrieve the attribute definition object of the property of interest from the schema container.
- 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.
| Method | Description |
|---|---|
| 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.
| Property | Access type | Description |
|---|---|---|
| Read-only |
Gets the object's ADsPath that uniquely identifies this object from all others. | |
| Read-only |
Gets the name of the object's schema class. | |
| Read-only |
Gets the GUID of the object as stored in the underlying directory store. | |
| Read/write |
Upper limit of values. | |
| Read/write |
Lower limit of values. | |
| Read/write |
Whether or not this is a property that supports multiple values. | |
| Read-only |
Gets the object's relative name. | |
| Read/write |
Directory-specific object identifier. | |
| Read-only |
Gets the ADsPath string for the parent of the object. | |
| Read-only |
Gets the ADsPath string to the schema class object for this object. | |
| 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 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Header |
|
|
DLL |
|
|
IID |
IID_IADsProperty is defined as C8F93DD3-4AE0-11CF-9E73-00AA004A5691 |
See also
Send comments about this topic to Microsoft
Build date: 10/26/2012
