28 September 2015

Powershell enum type

Add-Type -TypeDefinition @"
    public enum MyEnum{
        Paper,
        Rock,
        Scisor
    }
"@

[MyEnum]$abc = [MyEnum]::Rock

01 September 2015

LDAP syntax filters


=
Equality
>=
Greater than or equal to (lexicographical)
<=
Less than or equal to (lexicographical)
&
AND, all conditions must be met
|
OR, any of the conditions must be met
!
NOT, the clause must evaluate to False


all user object filter:  (&(objectCategory=person)(objectClass=user)) 

a more efficient all user object filter: (sAMAccountType=805306368)