IAdmSearchResult

The IAdmSearchResult interface represents a search result entry.

Inheritance: IEnumerable

Methods

Properties

  • Property

  • Description

  • AdsPath

  • Gets or sets the ADS path of the directory object represented by this search result entry.

  • Name

  • Gets the relative distinguished name (RDN) of the directory object represented by this search result entry.

  • ObjectType

  • Gets the object class of the directory object represented by this search result entry.

  • IsDeleted

  • Gets a value that indicates whether a directory object represented by this search result entry is deleted.

  • Count

  • Gets the number of properties in the entry.

Details

GetPropertyByName()

Returns a property by its name. If the property is not found in the entry, the method throws the COMException exception with the E_ADS_PROPERTY_NOT_FOUND error code.

IAdmSearchResultProperty GetPropertyByName(string propertyName)

GetPropertyByIndex()

Returns a property by index. If there is no property at the specified index, the method throws the COMException exception with the E_ADS_PROPERTY_NOT_FOUND error code.

IAdmSearchResultProperty GetPropertyByIndex(int propertyIndex)

Add()

Adds a property to the search result entry.

void Add(IAdmSearchResultProperty property)

Parameters

The property parameter specifies the property to be added.


AddEx()

Adds a property to the search result entry. Unlike the Add method, this method allows you to add a property without creating an instance of the AdmSearchResultProperty class.

void AddEx(string propertyName,
           ADSTYPEENUM propertyType,
           object propertyValues)

Parameters

  • propertyName - Specifies the name of the property to be added.
  • propertyType - Specifies the ADSI type of the property to be added.
  • propertyValues - Specifies the value for the property to be added. To add multiple values, pass an object[] array.

Examples

The following code sample adds a single-valued and a multi-valued property to a search result entry.

PowerShell
# The $searchResult variable represents a search result entry

# Add a single-valued property
$searchResult.AddEx("description", "ADSTYPE_UNKNOWN", "My description")

# Add a multi-valued property
$searchResult.AddEx("otherhomePhone", "ADSTYPE_UNKNOWN", @("550-440-330","550-440-331"))
C#
// The $searchResult variable represents a search result entry

// Add a single-valued property
searchResult.AddEx("description", ADSTYPEENUM.ADSTYPE_UNKNOWN, "My description");

// Add a multi-valued property
searchResult.AddEx("otherhomePhone", ADSTYPEENUM.ADSTYPE_UNKNOWN, 
    new object[] { "550-440-333", "550-440-334" });

Remove()

Removes a property from the search result entry. If the property is not found in the entry, the method throws the COMException exception with the E_ADS_PROPERTY_NOT_FOUND error code.

void Remove(string propertyName)

Parameters

The propertyName parameter specifies the name of the property to remove.


PutProperty()

Puts a property to the search result entry. If the property already exists in the search result, the method replaces it with the new one.

void PutProperty([In] IAdmSearchResultProperty property)

Parameters

The property parameter specifies the property to put.


AddEmptyValuesForNonExistingProperties()

Adds an empty value for each property listed in the propertyNames parameter if the search result entry doesn't contain a value for the property.

void AddEmptyValuesForNonExistingProperties(string[] propertyNames, 
                                            bool skipAdaxesCalculatedProperties)

Parameters

  • propertyNames - Specifies an array of property names.
  • skipAdaxesCalculatedProperties - If set to true, the method skips Adaxes calculated properties.

ContainsProperty()

Determines whether a property with the specified name is present in this search result entry.

bool ContainsProperty(string propertyName)

Parameters

The propertyName parameter specifies the name of a property to be checked.


Clone

Creates a copy of the search result.

IAdmSearchResult Clone(bool clonePathAndValues)

Parameters

If the clonePathAndValues parameter is set to true, the ADS path and the properties of the source search result are copied to the new search result object by value. Otherwise, they are copied only by reference.


GetEnumerator()

Retrieves an enumerator object for this search result entry. The enumerator object implements the IEnumerator interface that can be used to enumerate properties in foreach loops.

IEnumerator GetEnumerator()

AdsPath

Gets or sets the ADS path of the directory object represented by this search result entry.

  • Type:
  • string
  • Access:
  • Read/Write

Name

Gets the relative distinguished name (RDN) of the directory object represented by this search result entry.

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

ObjectType

Gets the object class of the directory object represented by this search result entry.

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

IsDeleted

Gets a value that indicates whether a directory object represented by this search result entry is deleted.

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

Count

Gets the number of properties in the entry.

  • Type:
  • int
  • Access:
  • Read-only

Requirements

Minimum required version: 2023

See also