win32com and adsi

Lars Kellogg-Stedman lars_news at larsshack.org
Thu Aug 22 10:36:28 EDT 2002


Howdy all,

I spent some time recently playing with win32com and while many things 
work as expected, I've been unable to get some features to work.  For 
example, I'd like to translate the following vbscript to Python:

   pdc = GetObject('WinNT://DOMAIN')
   pdc.Filter = Array("User")
   for each user in pdc
     msgbox user.Name
   next

I tried:

   from win32com import *

   pdc = GetObject('WinNT://DOMAIN')
   pdc.Filter = ['User']
   for user in pdc:
     print user.Name

The GetObject call seems to work -- it returns a
<COMObject WinNT://DEAS-CSG> object.  However, attempts to iterate over 
that object just hang.

Is this idiom supported by the win32com module?  Or are there any 
glaring errors in what I'm trying to do?

Thanks,

-- Lars




More information about the Python-list mailing list