Search-Filter for LDAP (MS Active Directory)
tim.golden at viacom-outdoor.co.uk
Fri Oct 15 17:50:58 CEST 2004
| I asked here a few weeks ago the same question but the answer of Tim
| Golden didn't really help yet.
| I'd like to know how to set up a query for all computer-accounts in a
| special part of Active Directory by using LDAP.
OK. I imagine that this is far too late to solve your particular
problem, and several others have already provided LDAP-based solutions
but... I've uploaded a module-wrapper round Microsoft's LDAP:// object
I'll try to put some info on that site to support it, but
it's fairly simple, fairly well-commented within, and I'll
add an example below to match your situation.
| all computers with a name like "ABC*" at "..., ou=Production,
ad = active_directory.AD ()
production = ad.child ("ou=production")
for computer in production.search (["objectClass=computer",
print "Properties used:", [p for p in computer.properties if getattr
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
More information about the Python-list