VB code -> Python

waldekO osuchw at ecn.ab.ca
Fri Feb 15 17:07:34 EST 2002


Mikael Lexén <mikael.lexen at stop.spam.volvo.com> wrote in message 

> So my questin is how do I translate the GetObject(...) thing in to
> Python code. 

To get info about user groups here you have two options here (thanks
to Mark Hammond of course)

1. You can use Windows API calls from win32.  Look at win32netdemo.py
located in win32\demos directory
2. Or newer ADSI based interface.  Examples are in
\win32comext\adsi\test.py

>>from win32com.adsi import *
>>me = ADsGetObject('WinNT://CAMELLOTNT/osuchwa',IID_IADsUser)
>>me.get_FullName()
u'Waldemar Osuch'

waldekO



More information about the Python-list mailing list