Listing computers of a WinNT-Domain

Dirk Hagemann usenet at mail-2-me.com
Thu Nov 6 03:23:17 EST 2003


Hi!
I'm using this code to list all computers of our WinNT-Domains:
import win32com.client
from pprint import pprint as p

domain='domainX'
auswahl='computer'

def enumerate(domain,auswahl):
	adsi = win32com.client.Dispatch("ADsNameSpaces")
	nt = adsi.GetObject("","WinNT:")
	result = nt.OpenDSObject("WinNT://"+domain+"","","",0)
	result.Filter = [auswahl] # computer, user, group
	domain = []
	for machine in result:
		domain.append(machine.Name)
	return domain
p(enumerate(domain,auswahl))

This works well with all domains except one domain. One of the domains
returns an emty list of computers, but it returns users an groups if I
set the filter accordingly; just the computers are missing (even if I
do not filter).
One week ago it was fully working... What can have happend? Any idea
anybody?

Regards
Dirk

PS: the computers are still existing in this domain.




More information about the Python-list mailing list