API Reference
SearchResultExtensions
Extension methods for SearchResult to make property access cleaner
Inheritance
- Object
- SearchResultExtensions
Methods
public static Nullable<Boolean> GetBool(SearchResult result, String propertyName) #Nullable<Boolean>Gets a property as a boolean.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Byte[] GetBytes(SearchResult result, String propertyName) #Byte[]Gets a property as byte array.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Byte[] GetBytesProperty(SearchResult result, String propertyName) #Byte[]Safely extracts a byte[] property from SearchResult.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static String[] GetClasses(SearchResult result) #String[]Returns the object's class list (objectClass multi-value).
Parameters
- result System.DirectoryServices.SearchResult
public static Nullable<DateTime> GetDateTime(SearchResult result, String propertyName) #Nullable<DateTime>Gets a property as a DateTime.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Nullable<DateTime> GetFileTime(SearchResult result, String propertyName) #Nullable<DateTime>Gets a property interpreted as Windows file time.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Nullable<Guid> GetGuid(SearchResult result, String propertyName) #Nullable<Guid>Gets a property as Guid.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Nullable<Guid> GetGuidProperty(SearchResult result, String propertyName) #Nullable<Guid>Safely extracts Guid property from SearchResult (handles byte[] and string forms).
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Nullable<Int32> GetInt(SearchResult result, String propertyName) #Nullable<Int32>Gets a property as an integer.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Nullable<Int64> GetLong(SearchResult result, String propertyName) #Nullable<Int64>Gets a property as a 64-bit integer.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Byte[][] GetMultiBytes(SearchResult result, String propertyName) #Byte[][]Gets a multi-valued byte[] property.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Guid[] GetMultiGuid(SearchResult result, String propertyName) #Guid[]Gets a multi-valued Guid property.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static String[] GetMultiString(SearchResult result, String propertyName) #String[]Gets a multi-valued string property.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static String GetSidString(SearchResult result, String propertyName = "objectSid") #StringGets a SID as a string (handles byte[] and SID objects).
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String = "objectSid"
public static String[] GetSidStrings(SearchResult result, String propertyName = "sIDHistory") #String[]Gets multi-valued SID strings from a property like sIDHistory.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String = "sIDHistory"
public static String GetString(SearchResult result, String propertyName) #StringGets a property as a string.
Parameters
- result System.DirectoryServices.SearchResult
- propertyName System.String
public static Boolean HasFlag(SearchResult result, Int32 flag, String propertyName = "userAccountControl") #BooleanChecks if a flag is set on the userAccountControl.
Parameters
- result System.DirectoryServices.SearchResult
- flag System.Int32
- propertyName System.String = "userAccountControl"
public static Boolean TryGetDistinguishedName(SearchResult result, out String distinguishedName) #BooleanBest-effort extraction of distinguishedName from a SearchResult.
Parameters
- result System.DirectoryServices.SearchResult
- distinguishedName System.String@