Listing all machines in a domain

Dirk Hagemann dirkhagemann at firemail.de
Wed Oct 15 07:54:16 EDT 2003


Hello!

I need to get a list of all machines in a (Windows-)domain. So I used
as described in the ActiveState Python Documentation
win32net.NetServerEnum('',100,win32netcon.SV_TYPE_ALL,'domain-x') to
get this list from the PDC. But the result is only a list of all
machines which are logged-in. What I really need is a list of ALL
machines - taht means also the machines which belong to this domain,
but are logged-off (or simply switched-off).

A colleague did it in Perl with this code:
Win32::AdminMisc::GetMachines( $dc, UF_WORKSTATION_TRUST_ACCOUNT,
\%wkslist, ""  );
This retrieves a whole list of the machines of a domain.
How can I do this in Python???

Thanks a lot for your response!

Dirk




More information about the Python-list mailing list