- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2020 10:35 PM
Hi All,
We have starting search directory OU=Users,OU=CompanyA,DC=abc,DC=com, DC=au
We have sub OU called contractors (OU=Contractors) so in AD, it will be OU=Contractors,OU=Users,OU=CompanyA,DC=abc,DC=com, DC=au
How do I exclude OU=Contractors?
I have LDAP OU Definition
Query field = sAMAccountName
Filter = (&(objectClass=person)(sn=*)(!(objectClass=computer)) (!(userAccountControl:1.2.840.113556.1.4.803:=2)))
I've tried to add (!(OU=Contractors)), but this doesn't seem to exclude when I browse or do test load.
Modified filter = (&(objectClass=person)(sn=*)(!(objectClass=computer)) (!(OU=Contractors)) (!(userAccountControl:1.2.840.113556.1.4.803:=2)))
Thank you in advanced for your assistance.
Solved! Go to Solution.
- Labels:
-
MID Server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2021 10:18 PM
ServiceNow said this is not possible to filter by OU after the searchbase is defined.
If want to be excluded under the searchbase, requires an exclusion using Attributes.
For example:
If you would like to exclude employeeType=Contractor, then use the following filter.
(&(objectClass=person)(sn=*)(!(objectClass=computer)) (!(employeeType=Contractor))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2021 10:18 PM
ServiceNow said this is not possible to filter by OU after the searchbase is defined.
If want to be excluded under the searchbase, requires an exclusion using Attributes.
For example:
If you would like to exclude employeeType=Contractor, then use the following filter.
(&(objectClass=person)(sn=*)(!(objectClass=computer)) (!(employeeType=Contractor))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))