IAdmObjectSnapshot

The IAdmObjectSnapshot interface represents a serialized instance of a directory object. You can get a snapshot of a directory object and further use it to manage the object properties locally, without the need to query the directory. This is often used to improve performance and reduce network traffic between the client and the service.

Inheritance: IUnknown

Methods

  • Method

  • Description

  • Get()

  • Gets the value of a property by name.

  • GetEx()

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

  • Put()

  • Sets a value of a property by name.

  • PutEx()

  • Sets a value of a single or multi-valued property by name.

Properties

  • Property

  • Description

  • ADsPath

  • Gets the ADS path that uniquely identifies this directory object.

  • Class

  • Gets the name of the object schema class.

  • GUID

  • Gets the globally unique identifier (GUID) of the object as stored in the directory.

  • Name

  • Gets the object's relative distinguished name (RDN).

  • Parent

  • Gets the ADS path of the parent container or organizational unit of the object.

  • Schema

  • Gets the ADS path string to the schema class object for the directory object.

  • PropertyList

  • Gets the property list of the directory object.

  • IsObjectBound

  • Identifies whether the object is bound to the directory or not.

Details

Get()

Gets the value of a property by name. The property can be single-valued or multi-valued. The property value is represented either as an object if there is one value, or an object[] if there are several. It is important to point out that a multi-valued property with one value counts as a single value, so an object will be returned.

If the multi-valued property is of a binary type, the method returns an array of bytes (Byte[]).

object Get(string name)

Parameters

  • name – the property name.

Remarks

This method requires you to handle return values differently, depending on whether the property has one or several values.

You can also use GetEx to retrieve property values. That method always returns property values as an object[]. It saves you the effort of validating the data types when unsure whether the returned data has single or multiple values.


Gets the value of a property by name. The property can be single-valued or multi-valued. Unlike the Get method, the property values are always returned as an object[] array. A single-valued property is represented as an array with a single element.

object GetEx(string name)

Parameters

  • name – the property name.

Remarks

The Get and GetEx methods return different data structures for a property with a single value. For example, if the property is a string, Get returns a string object, whereas GetEx returns a string[] array with a single element. If you are not sure whether a multi-valued property will return one or multiple values, use GetEx.


Put()

Sets a value for a given property.

void Put(string name, object value)

Parameters

  • name – the property name.
  • value – the new property values.

Remarks

To manipulate the property values beyond a simple assignment, use PutEx. For example, to append or remove a value from an existing array of property values.


PutEx()

Sets a value for a single or multi-valued property by name. For properties that allow multiple values, you can append additional values to an existing set of values, modify the values in the set, remove specified values from the set, or delete values from the set.

void PutEx(ADS_PROPERTY_OPERATION_ENUM controlCode,
           string name, 
           object[] value)

Parameters

  • controlCode – a control code that indicates the modification mode: Append, Replace, Remove, and Delete.
  • name – the property name.
  • value – an object[] array that contains property values. A single-valued property is represented as an array with a single element. If the controlCode parameter is set to ADS_PROPERTY_CLEAR, the value of the property specified by the value parameter is irrelevant.

Remarks

PutEx enables you to append values to an existing set of values of a multi-valued property using the ADS_PROPERTY_APPEND control code. Duplicate values are not accepted for multi-valued properties. If you call PutEx to append a duplicate value to a multi-valued property of a directory object, the PutEx call will succeed, but the duplicate value will be ignored.

Similarly, if you use PutEx to delete one or more values from a multi-valued property of a directory object, the operation will not throw an error, even if all of the specified values do not exist.


ADsPath

Gets the object's ADS path that uniquely identifies it. The object can always be retrieved using this path.

  • Type:
  • string
  • Access:
  • Read-only

Class

Gets the name of the object's schema class.

  • Type:
  • string
  • Access:
  • Read-only

GUID

Gets the globally unique identifier (GUID) of the object as stored in the directory. The IADs interface converts the GUID from an octet string, as stored on a directory server, into a string format.

  • Type:
  • string
  • Access:
  • Read-only

Remarks

The GUID value returned from property is a string of hexadecimals. Use this GUID to bind to the directory object directly.

Adaxes://servername/<GUID=xxx>

Where xxx is the value returned from the property.


Name

Gets the object's relative name (RDN). This name distinguishes this object from its siblings. Example: CN=John Smith.

  • Type:
  • string
  • Access:
  • Read-only

Parent

Gets the ADS path of the parent container or organizational unit of the object.

  • Type:
  • string
  • Access:
  • Read-only

Schema

Gets the ADS path string to the schema class object for the directory object.

  • Type:
  • string
  • Access:
  • Read-only

PropertyList

Gets the property list of the directory object. The list is represented by the IAdmPropertyList interface, which allows you to read and update the list of property entries in the property cache of the object.


IsObjectBound

Use this property to identify whether the object is bound to the directory or not.

  • Type:
  • bool
  • Access:
  • Read-only

Requirements

Minimum required version: 2009.1

See also