IAdmSearchResult
The IAdmSearchResult interface represents a search result entry.
Inheritance: IEnumerable
Methods
-
Method
-
Description
-
GetPropertyByName()
-
Returns a property by name.
-
GetPropertyByIndex()
-
Returns a property by index.
-
Add()
-
Adds a property to the search result entry.
-
AddEx()
-
Adds a property to the search result entry. Unlike the
Addmethod, this method allows you to add a property without creating an instance of the AdmSearchResultProperty class. -
Remove()
-
Removes a property from the search result entry.
-
PutProperty()
-
Puts a property into the search result entry.
-
AddEmptyValuesForNonExistingProperties()
-
Adds an empty value for each specified property if the search result entry doesn't contain a value for that property.
-
ContainsProperty()
-
Determines whether a property with the specified name is present in this search result entry.
-
Clone
-
Creates a copy of the search result.
-
GetEnumerator()
-
Retrieves an enumerator object for this search result entry.
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 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 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
- property – the property to add.
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 – the name of the property to add.
- propertyType – the ADSI type of the property to add.
- propertyValues – the value for the property. To add multiple values, pass an
object[]array to this parameter.
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
- propertyName – the name of the property to remove.
PutProperty()
Puts a property into 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
- property – 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 that property.
void AddEmptyValuesForNonExistingProperties(string[] propertyNames,
bool skipAdaxesCalculatedProperties)
Parameters
- propertyNames – an array of property names.
- skipAdaxesCalculatedProperties – set to
trueto skip Adaxes calculated properties.
ContainsProperty()
Determines whether a property with the specified name is present in this search result entry.
bool ContainsProperty(string propertyName)
Parameters
- propertyName – the name of a property to check.
Clone
Creates a copy of the search result.
IAdmSearchResult Clone(bool clonePathAndValues)
Parameters
- clonePathAndValues – set to
trueto copy the ADS path and the properties of the source search result to the new search result object by value. Set tofalseto copy 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 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