[python-win32] PDC vs VLAN cage match.

d.w. harks dave at psys.org
Tue Jul 22 14:08:00 EDT 2003


In our last episode, d.w. harks expounded thusly:
> In our last episode, Sean expounded thusly:
> > Recently VLANS were setup on the network I use.
> > 
> > Since then the GetServers or win32net.NetServerEnum functions only return
> > the names of the machines on the same VLAN as the PDC.  This I understand
> > but unfortunately I need to get the name of every machine on the entire
> > domain (which spans vlans).  The two PDC's both have all the machine's in
> > their list.  Is there a way to get the contents of the listing (via NT4
> > Server Manger)?  Is it possible to just enumerate all the members of a
> > NT domain regardless of wheter you get broadcasts from each member?
> > 
> > Is there some specific thing I have to set in windows to allow it to 'see'
> > machines beyond it's VLAN?
> > 
> > Any pointers in the right direction would be appriciated,
> > 
> > -- 
> > Sean
> 
> Are you using WINS? 
> 
> dave

OK, another way to do it would be to use ADSI with the WinNT provider and do
a listing of everything on the domain, like this:

import win32com.client

adsi = win32com.client.Dispatch("ADsNameSpaces")
nt = adsi.GetObject("", "WinNT:")

dom = nt.OpenDSObject("WinNT://DOM", "user", "password", 0)

dom.Filter = ["computer"]

for comp in dom:
    print comp.Name


-- 
David W. Harks <dave at psys.org>  http://dwblog.psys.org



More information about the Python-win32 mailing list