Python/COM/ADSI - Newbie questions

O

Ondrej Krajicek

Hello all,

to date, I've done python programming for various
reasons and projects and I quite like it. I've been
using Win32All extensions and I am happy with
them.

Now, I have to create some scripts which utilize
COM (my project involves replicating _huge_ amounts of data
to and from Active Directory).
I am familiar with COM in C++, but with PythonCOM,
I am completely lost :-((. So please forgive me for my
stuping questions ;-).

So...

I want/have to use lower level ADSI interfaces, such
as IDirectoryObject and IDirectorySearch, for performance
reasons. And also, I want to avoid automation objects
at all costs (calling via IDispatch).

How do I just cast the COM object to (say) IDirectoryObject?
Where are my IID_* (IID_IADs, IID_IDirectorySearch, ...) constants,
I do need my IID_* constants ;-)).

I want to use a binding pattern, which works well in
C++:

1. ADsOpenObject('LDAP://RootDSE', 'UserName', 'Password',
ADS_SECURE_AUTHENTICATION)

2. Obtain default naming context NC from RootDSE

3. Obtain IDirectorySearch and IDirectoryObject on the default
naming context

4. etc.

I am able to interact with ADSI using win32com.client.Dispatch(),
but this is not the way I want to go.

Thanks for any clues. Are there any code samples I can look
at?

Best regards,

Ondra Krajicek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top