win32com and adsi

Lars Kellogg-Stedman lars_news at
Thu Aug 22 16:36:28 CEST 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

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?


-- Lars

More information about the Python-list mailing list