Question : LDAP Queries - Find mailbox enabled users that are not disabled and dosnt start with Q or X.

Hi, I need some help, since i suck at ldap queries...

What i would like is a querie that includes all mailbox enabled user accounts that are _not_ disabled AND do _not_ start with Q or X in they're logon name (or E-mail: on general tap i AD f.ex. [email protected])

i tried:
(objectCategory=user) (| (!userPrincipalName=x*) (!userPrincipalName=q*))

But this dosnt seem to work.

Bonus help:
How could you automatic update a dist grp based on the same querie, this could be like a daily job or something.

Answer : LDAP Queries - Find mailbox enabled users that are not disabled and dosnt start with Q or X.

Oops, cut and paste error. This is the correct syntax:

(&(objectClass=user)(objectCategory=person)(homeMDB=*)(!userAccountControl:1.2.840.113556.1.4.803:=2)(!userPrincipalName=q*)(!userPrincipleName=x*))

Random Solutions  
 
programming4us programming4us