Filtering via OU



Hi folks,

Quick question. I wish to do a search on a whole domain, but I wish to
exclude specific domains.

My current search is this:

' Retrieve lastLogon attribute for each user on each Domain Controller.
For k = 0 To Ubound(arrstrDCs)
strBase = "<LDAP://"; & arrstrDCs(k) & "/" & strDNSDomain & ">"
strFilter = "(&(objectCategory=person)(objectClass=user))"
strAttributes = "distinguishedName,lastLogon,description"
strQuery = strBase & ";" & strFilter & ";" & strAttributes &
";subtree

(thanks to Richard Mueller for large bits of the script)

Basically, I wish to exclude say two OUs called OU=disabled
users,DC=domain,DC=com & OU=resource accounts,OU=users,DC=domain,DC=com
- how is this done? I can get a filter using "memberof", but that is
member of a group rather than a member of a OU sadly.

Thanks in advance!

Rich

.



Relevant Pages

  • Re: Slow member loading in excel 2003 pivot table
    ... really interresting idea! ... I'm going to try it but wouldn't that give me "wrong" measures if i simply exclude these low count values? ... "Deepak Puri" wrote in message ... "unknown" member. ...
    (microsoft.public.sqlserver.olap)
  • RE: PivotList Control - Setting the Members of a Row or Column Axi
    ... For this scenario, when we specify the included member, we still need to ... exclude other members. ... Please see my sample code: ... Dim pview As PivotView ...
    (microsoft.public.office.developer.web.components)
  • RE: help with criteria
    ... with members that you wanted to exclude, ... I'm a little unsure which query sql you sent, ... provided rowno in the Memb/loan table is a reference to ... the member id in the member table (I assume that rowno in ...
    (microsoft.public.access.queries)
  • Re: Was Aetheism.
    ... >>>clubs that exclude nonwhites (or Jews, or Catholics, or Irish, ... No it is not exclusion they can not hold a Warrant because they can ... >>member of the SA. ... >They obviously exclude atheists, bigot. ...
    (uk.rec.scouting)

Loading