Using Ldap search filter

May 12, 2014 at 8:36 AM
thanks for the very useful scripts and in particular for Set-WSS-Contact-List-From-ActiveDirectory
Can I use LDAP search filter in this script like this: (objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)) ?
If I can, how can I do that?
May 14, 2014 at 9:51 AM
Dear Nikit,
Cou can simply change the line :
$strFilter = "(&(objectCategory=user)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(givenName=*)(sn=*)(samaccountname=*))"
With your personal filter.

Comment this line a put just after the line :
$strFilter = "(&(objectCategory=user)(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"