Class Query
Query is a query builder for Active Directory queries
Inherited Members
Namespace: Dapplo.ActiveDirectory.Entities
Assembly: Dapplo.ActiveDirectory.dll
Syntax
public class Query : QueryElement
Properties
| Improve this Doc View SourceAnd
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 |
AND
AND query
Declaration
public static Query AND { get; }
Property Value
Type | Description |
---|---|
Query | Query |
Operator
The operator for this query
Declaration
public Operators Operator { get; }
Property Value
Type | Description |
---|---|
Operators |
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 |
OR
OR query
Declaration
public static Query OR { get; }
Property Value
Type | Description |
---|---|
Query | Query |
Methods
| Improve this Doc View SourceBuild()
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 |
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 |
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 |
ToString()
Build this query element as a string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
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 |
WhereAccountDisabled()
Make the query look for enabled accounts
Declaration
public Query WhereAccountDisabled()
Returns
Type | Description |
---|---|
Query | Query |
WhereAccountEnabled()
Make the query look for disabled accounts
Declaration
public Query WhereAccountEnabled()
Returns
Type | Description |
---|---|
Query | Query |
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 |
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 |
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 |
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 |
WhereIsComputer()
Make the query look for the computer objectCategory
Declaration
public Query WhereIsComputer()
Returns
Type | Description |
---|---|
Query | Query |
WhereIsUser()
Make the query look for the user objectCategory
Declaration
public Query WhereIsUser()
Returns
Type | Description |
---|---|
Query | Query |
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 |
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 |
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 |
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 |