Filtering via OU
- From: rhfreeman@xxxxxxxxx
- Date: 10 May 2006 09:52:37 -0700
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
.
- Follow-Ups:
- Re: Filtering via OU
- From: Richard Mueller
- Re: Filtering via OU
- Prev by Date: Re: SQL commands from VBScript?
- Next by Date: Re: Newbie scripting. Modifying the registry.
- Previous by thread: Methods to use with the registry
- Next by thread: Re: Filtering via OU
- Index(es):
Relevant Pages
|
Loading