TestimoX

API Reference

Class

DirectoryEntryPropertyExtensions

Namespace ADPlayground.Helpers
Assembly ADPlayground
Modifiers static

Extension methods for easier DirectoryEntry property access.

Inheritance

  • Object
  • DirectoryEntryPropertyExtensions

Methods

public static Nullable<Boolean> GetBool(DirectoryEntry entry, String propertyName) #
Returns: Nullable<Boolean>

Gets a property as boolean.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static Byte[] GetBytes(DirectoryEntry entry, String propertyName) #
Returns: Byte[]

Gets a property as byte array.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static String[] GetClasses(DirectoryEntry entry) #
Returns: String[]

Returns the object's classes (objectClass multi-value).

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
public static Nullable<DateTime> GetDateTime(DirectoryEntry entry, String propertyName) #
Returns: Nullable<DateTime>

Gets a property as DateTime.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static String GetDistinguishedName(DirectoryEntry entry) #
Returns: String

Returns object's distinguishedName, falling back to parsing from Path when not loaded.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
public static Nullable<DateTime> GetFileTime(DirectoryEntry entry, String propertyName) #
Returns: Nullable<DateTime>

Gets a property as file time.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static Nullable<Guid> GetGuid(DirectoryEntry entry, String propertyName) #
Returns: Nullable<Guid>

Gets a property as a Guid.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static Nullable<Int32> GetInt(DirectoryEntry entry, String propertyName) #
Returns: Nullable<Int32>

Gets a property as integer.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static Byte[][] GetMultiBytes(DirectoryEntry entry, String propertyName) #
Returns: Byte[][]

Gets a multi-valued byte[] property.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static Guid[] GetMultiGuid(DirectoryEntry entry, String propertyName) #
Returns: Guid[]

Gets a multi-valued Guid property.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static String[] GetMultiString(DirectoryEntry entry, String propertyName) #
Returns: String[]

Gets a multi-valued string property.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
public static String GetString(DirectoryEntry entry, String propertyName) #
Returns: String

Gets a property as a string.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
Directory entry.
propertyName System.String requiredposition: 1
Property name.
public static Boolean HasFlag(DirectoryEntry entry, Int32 flag, String propertyName = "userAccountControl") #
Returns: Boolean

Checks a flag value.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
flag System.Int32 requiredposition: 1
propertyName System.String = "userAccountControl" optionalposition: 2
public static Void SetInt(DirectoryEntry entry, String propertyName, Int32 value) #
Returns: Void

Sets an integer property value safely (wraps exceptions with logging).

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
value System.Int32 requiredposition: 2
public static Void SetMultiString(DirectoryEntry entry, String propertyName, IEnumerable<String> values) #
Returns: Void

Sets a multi-string property value safely.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
values System.Collections.Generic.IEnumerable{System.String} requiredposition: 2
public static Void SetString(DirectoryEntry entry, String propertyName, String value) #
Returns: Void

Sets a string property value safely.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0
propertyName System.String requiredposition: 1
value System.String requiredposition: 2
public static ActiveDirectorySecurity TryGetObjectSecurity(DirectoryEntry entry) #
Returns: ActiveDirectorySecurity

Safely gets the object's security descriptor (DACL). Returns null when unavailable.

Parameters

entry System.DirectoryServices.DirectoryEntry requiredposition: 0