Seaching Active Directory via ADO

LittlePython LittlePython at lost.com
Thu Feb 16 21:59:40 EST 2006


Do you know what this may mean?

C:\Documents and Settings\Administrator\Desktop\pytest>ADOSeach.py
Traceback (most recent call last):
  File "C:\Documents and Settings\Administrator\Desktop\pytest\ADOSeach.py",
lin
e 6, in ?
    rs,rc=c.Execute("""
  File "<COMObject ADODB.Connection>", line 3, in Execute
  File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py", line 258,
in
_ApplyTypes_
    result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes
) + args)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Provider',
'Tabl
e does not exist.', None, 1240640, -2147217865), None)

C:\Documents and Settings\Administrator\Desktop\pytest>
"Roger Upole" <rupole at hotmail.com> wrote in message
news:1140144965_1489 at sp6iad.superfeed.net...
> You could also accomplish the same thing using the
> Command object, but this way is usually more concise
> for plain Sql.
>
>          Roger
>
> "LittlePython" <LittlePython at lost.com> wrote in message
> news:UtaJf.78260$_D1.52493 at trnddc03...
> > I notice there is no adodb.command. This is not required?
> > Thx for the example!
> > "Roger Upole" <rupole at hotmail.com> wrote in message
> > news:1140142239_1425 at sp6iad.superfeed.net...
> > > Here's a short example that uses ADO to search for a
> > > user by wildcard.
> > >
> > > import win32com.client
> > > c = win32com.client.Dispatch("ADODB.Connection")
> > > c.Open("Provider=ADSDSOObject")
> > >
> > > rs,rc=c.Execute("""
> > > SELECT adspath, title, name
> > > From 'LDAP://DC=yourdomain, DC=COM'
> > > where objectClass='user' and name='Roger*'
> > > """)
> > >
> > > while not rs.EOF:
> > >     for f in rs.Fields:
> > >         print f.Name, f.Value
> > >     rs.MoveNext()
> > >
> > >     hth
> > >           Roger
> > >
> > > "LittlePython" <LittlePython at lost.com> wrote in message
> > > news:56aJf.78250$_D1.4370 at trnddc03...
> > > > Thanks but I was looking more for ADO com object than ADSI or ldap.
> > > > For some strange reason it is very hard to locate any working
scripts
> > that
> > > > use ADO  to connect and search AD. Is there an issue with ADO and
> python
> > > > when connecting to AD?
> > > > I have try to build one myself with no luck. I think my problem is
> with
> > > > adodb.command calls.
> > > >
> > > > Thanks for your response.
> > > >
> > > > "alex23" <wuwei23 at gmail.com> wrote in message
> > > > news:1140138661.484502.86380 at f14g2000cwb.googlegroups.com...
> > > > > Heya,
> > > > >
> > > > > There are a couple of examples on the O'Reilly site. These two are
> > > > > taken from 'Active Directory Cookbook', the first uses a COM
object
> > > > > while the second uses a native LDAP module:
> > > > >
> > > > >
> > > >
> > >
> >
>
http://www.rallenhome.com/books/adcookbook/src/18.6-rootdse_python_com.py.tx
> > > > t
> > > > >
> > > >
> > >
> >
>
http://www.rallenhome.com/books/adcookbook/src/18.6-rootdse_python_ldap.py.t
> > > > xt
> > > > >
> > > > > This might give you a start.
> > > > >
> > > > > - alex23
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> > > ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
> > News==----
> > > http://www.newsfeeds.com The #1 Newsgroup Service in the World!
120,000+
> > Newsgroups
> > > ----= East and West-Coast Server Farms - Total Privacy via Encryption
> > =----
> >
> >
>
>
>
> ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption
=----





More information about the Python-list mailing list