• 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 Query

Query is a query builder for Active Directory queries

Inheritance
System.Object
QueryElement
Query
Inherited Members
QueryElement.Parent
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.Entities
Assembly: Dapplo.ActiveDirectory.dll
Syntax
public class Query : QueryElement

Properties

| Improve this Doc View Source

And

Add an AND sub query to the current query

Declaration
public Query And { get; }
Property Value
Type Description
Query

Query which is a sub-query of the parent

| Improve this Doc View Source

AND

AND query

Declaration
public static Query AND { get; }
Property Value
Type Description
Query

Query

| Improve this Doc View Source

Operator

The operator for this query

Declaration
public Operators Operator { get; }
Property Value
Type Description
Operators
| Improve this Doc View Source

Or

Add an OR sub query to the current query

Declaration
public Query Or { get; }
Property Value
Type Description
Query

Query which is a sub-query of the parent

| Improve this Doc View Source

OR

OR query

Declaration
public static Query OR { get; }
Property Value
Type Description
Query

Query

Methods

| Improve this Doc View Source

Build()

Build the query to a string. This will go up the parent chain until there is none specified and starts calling ToString() on all elements going down the chain again.

Declaration
public string Build()
Returns
Type Description
System.String

string with the complete query

| Improve this Doc View Source

ForComputer(Value)

Create a query for a computer, optionally you can specify the name

Declaration
public static Query ForComputer(Value hostname = null)
Parameters
Type Name Description
Value hostname

hostname (without domain!)

Returns
Type Description
Query

Query

| Improve this Doc View Source

ForUser(Value)

Create a query for an user, optionally you can specify the name

Declaration
public static Query ForUser(Value username = null)
Parameters
Type Name Description
Value username

Windows username (without the domain)

Returns
Type Description
Query

Query

| Improve this Doc View Source

ToString()

Build this query element as a string

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()
| Improve this Doc View Source

Where(Property, Value, Comparisons)

Equal to

Declaration
public Query Where(Property property, Value value, Comparisons comparison)
Parameters
Type Name Description
Property property

property as Property, enum or string

Value value

Value to compare

Comparisons comparison

Comparisons to specify how to compare

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereAccountDisabled()

Make the query look for enabled accounts

Declaration
public Query WhereAccountDisabled()
Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereAccountEnabled()

Make the query look for disabled accounts

Declaration
public Query WhereAccountEnabled()
Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereAny(Property)

Check for the existance of a property

Declaration
public Query WhereAny(Property property)
Parameters
Type Name Description
Property property

property as Property, enum or string

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereEmpty(Property)

Check for an absent property

Declaration
public Query WhereEmpty(Property property)
Parameters
Type Name Description
Property property

property as Property, enum or string

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereEqualTo(Property, Value)

Property should be equal to the value

Declaration
public Query WhereEqualTo(Property property, Value value)
Parameters
Type Name Description
Property property

property as Property, enum or string

Value value

value to compare

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereGte(Property, Value)

Greater than or equal to

Declaration
public Query WhereGte(Property property, Value value)
Parameters
Type Name Description
Property property

property as Property, enum or string

Value value

value to compare to

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereIsComputer()

Make the query look for the computer objectCategory

Declaration
public Query WhereIsComputer()
Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereIsUser()

Make the query look for the user objectCategory

Declaration
public Query WhereIsUser()
Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereLte(Property, Value)

Less than or equal to

Declaration
public Query WhereLte(Property property, Value value)
Parameters
Type Name Description
Property property

property as Property, enum or string

Value value

value to compare to

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereNot(Property, Value)

Not equal to

Declaration
public Query WhereNot(Property property, Value value)
Parameters
Type Name Description
Property property

property as Property, enum or string

Value value

value to compare

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereObjectCategoryIs(Value)

Add an comparison for the objectCategory

Declaration
public Query WhereObjectCategoryIs(Value objectCategory)
Parameters
Type Name Description
Value objectCategory

Value for the objectCategory

Returns
Type Description
Query

Query

| Improve this Doc View Source

WhereObjectClassIs(Value)

Add an comparison for the objectClass, if possible use IsObjectCategory as this has a higher chance of being indexed.

Declaration
public Query WhereObjectClassIs(Value objectClass)
Parameters
Type Name Description
Value objectClass

string with the objectClass

Returns
Type Description
Query

Query

Extension Methods

ActiveDirectoryExtensions.Execute<T>(Query, String, String, String)
ActiveDirectoryExtensions.Execute<T>(Query, AuthenticationTypes, String, String, String)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © Dapplo