Link to home
Start Free TrialLog in
Avatar of Jorge Ocampo
Jorge OcampoFlag for United States of America

asked on

ADModify LDAP Query Help

Hi,

i am trying to search all users that do not contain a proxyaddress but seemed to be getting an invalid query error, any help would be appreciated.

(objectClass=user)(!(proxyAddresses:=*@DOMAINNAME.com)))
Avatar of Kevin Stanush
Kevin Stanush
Flag of United States of America image

Try:

(&(objectCategory=user)(!proxyAddresses=*))

For a visual way to do this, try Hyena (www.systemtools.com).  It will let you do this interactively by just running a query, and then you can sort on the ProxyAddresses column.

Video on modifying AD queries is here:

https://www.youtube.com/watch?v=1ONAhKyB61g
Avatar of Jorge Ocampo

ASKER

(&(objectCategory=user)(!proxyAddresses=*@DomainName.com))

also returning contacts :(
Sorry, just replace objectcategory=user to objectclass=user.  If you have a huge AD environment, we can optimize it with objectcategory some, but its probably not worth it.
that worked :) could we also include "and" contains(@DOMAINNAME2)

summary

Must be user
Does not contain
3*filter Contains"@Domainname2.com"
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This Guy is A Wizard!
Glad I could help.