• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.ActiveDirectory
    • ActiveDirectoryExtensions
    • ActiveDirectoryGlobals
    • AdPropertyAttribute
    • IAdObject
    • IAdObjectFactory
  • Dapplo.ActiveDirectory.Entities
    • Comparisons
    • DistinguishedName
    • Operators
    • Property
    • PropertyComparison
    • Query
    • QueryElement
    • Value
  • Dapplo.ActiveDirectory.Enums
    • AdProperties
    • ClassNames
    • ComputerProperties
    • DistinguishedNameAttributes
    • UserAccountControlFlags
    • UserProperties
  • Dapplo.ActiveDirectory.Extensions
    • AdDateTimeExtensions
    • DirectoryEntryPropertyExtensions
    • EnumExtensions
    • PropertyInfoExtension
  • Dapplo.ActiveDirectory.Finder
    • FinderAddonModule
    • Startup
  • Dapplo.ActiveDirectory.Finder.Configuration
    • IFinderTranslations
  • Dapplo.ActiveDirectory.Finder.Entities
    • IUser
  • Dapplo.ActiveDirectory.Finder.Ui.ViewModels
    • FinderViewModel
  • Dapplo.ActiveDirectory.Finder.Ui.Views
    • FinderView
  • Dapplo.ActiveDirectory.Internal
    • IAdsLargeInteger
    • IADsSecurityDescriptor
    • SimpleDictionaryProxy

Class ActiveDirectoryExtensions

A simple ActiveDirectory helper class

Inheritance
System.Object
ActiveDirectoryExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Dapplo.ActiveDirectory
Assembly: Dapplo.ActiveDirectory.dll
Syntax
public static class ActiveDirectoryExtensions

Methods

| Improve this Doc View Source

Execute<T>(Query, AuthenticationTypes, String, String, String)

Use the ActiveDirectory with the supplied domain to query, using the specified AuthenticationTypes

Declaration
public static IEnumerable<T> Execute<T>(this Query query, AuthenticationTypes authenticationType, string domain = null, string username = null, string password = null)
    where T : IAdObject
Parameters
Type Name Description
Query query

Query

System.DirectoryServices.AuthenticationTypes authenticationType

AuthenticationTypes used to specify the AuthenticationType, null to use the value from ActiveDirectoryGlobals.AuthenticationType

System.String domain

Domain for the LDAP server, if null the Domain.GetCurrentDomain().Name is used

System.String username

Username for the connection, by default the current user is used

System.String password

Password for the supplied user

Returns
Type Description
System.Collections.Generic.IEnumerable<T>

IEnumerable with the specified type

Type Parameters
Name Description
T

Type to fill, use AdPropertyAttribute to specify the mapping

| Improve this Doc View Source

Execute<T>(Query, String, String, String)

Use the ActiveDirectory with the supplied domain to query. The AuthenticationTypes for the connection is specified in ActiveDirectoryGlobals.AuthenticationType, or use the Execute where you can pass this.

Declaration
public static IEnumerable<T> Execute<T>(this Query query, string domain = null, string username = null, string password = null)
    where T : IAdObject
Parameters
Type Name Description
Query query

Query

System.String domain

Domain for the LDAP server, if null the Domain.GetCurrentDomain().Name is used

System.String username

Username for the connection, by default the current user is used

System.String password

Password for the supplied user

Returns
Type Description
System.Collections.Generic.IEnumerable<T>

IEnumerable with the specified type

Type Parameters
Name Description
T

Type to fill, use AdPropertyAttribute to specify the mapping

| Improve this Doc View Source

GetByAdsPath(String, String, String)

This is more for debugging, with retrieve the complete DirectoryEntry for the AdsPath

Declaration
public static DirectoryEntry GetByAdsPath(string adsPath, string username = null, string password = null)
Parameters
Type Name Description
System.String adsPath

string with the AdsPath, this can be retrieved by setting AdProperty(AdProperties.Id) on a string property for the type passed to Execute

System.String username

Username for the connection, by default the current user is used

System.String password

Password for the supplied user

Returns
Type Description
System.DirectoryServices.DirectoryEntry

DirectoryEntry

| Improve this Doc View Source

ToDisplayString(DirectoryEntry, String)

Convert a property in the AD to a string

Declaration
public static string ToDisplayString(this DirectoryEntry directoryEntry, string propertyName)
Parameters
Type Name Description
System.DirectoryServices.DirectoryEntry directoryEntry

DirectoryEntry

System.String propertyName

string

Returns
Type Description
System.String

string

| Improve this Doc View Source

Update<TAdContainer>(TAdContainer, DirectoryEntry)

If you want to update information, the minimum what the passed container needs is a property with AdProperties.Id

Declaration
public static void Update<TAdContainer>(this TAdContainer adContainerObject, DirectoryEntry directoryEntry)
    where TAdContainer : IAdObject
Parameters
Type Name Description
TAdContainer adContainerObject

object which has the values to update

System.DirectoryServices.DirectoryEntry directoryEntry

DirectoryEntry

Type Parameters
Name Description
TAdContainer

The type of the AD Container object

| Improve this Doc View Source

Update<TAdContainer>(TAdContainer, String, String)

If you want to update information, the minimum what the passed container needs is a property with AdProperties.Id

Declaration
public static void Update<TAdContainer>(this TAdContainer adContainerObject, string username = null, string password = null)
    where TAdContainer : IAdObject
Parameters
Type Name Description
TAdContainer adContainerObject

object which has the values to update

System.String username

Username for the connection, by default the current user is used

System.String password

Password for the supplied user

Type Parameters
Name Description
TAdContainer

The type of the AD Container object

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © Dapplo