[Karlo Lozovina]

| I've been Googling around for easiest way to do these three things
| withoin a Python script:
| 
| - get a list of workgroups on LAN
| - get a list of computers in workgroup
| - get a list of shares of a computer
| 
| And i found next to nothing :(. The best I could do is try to use "net
| view" and parse it's output, but that seems really bad to me.
| 
| Is there a better and more simple way?

At the risk of sounding peevish, did actually try
what I suggested to you on the main Python list,
and Google within the c.l.py group?

Just to save you the effort:

Here's one (by me) to list workgroups/domains:
http://groups.google.com/group/comp.lang.python/msg/d448ab26621ee8bf
Here's another one (by me) to list machines in a domain:
http://groups.google.com/group/comp.lang.python/msg/2aa365a285899845
Here's one to list shares: 
http://groups.google.com/group/comp.lang.python/msg/461ee641b16c2f96

I'm not 100% sure that the code which lists domains
does the same for workgroups; I just hope so.

Failing that, you need to look at the win32net / win32wnet
modules in pywin32, specifically at things like NetShareEnum.
Also, have a look at the MS docs for the WinNT object, which
can often do these things quite neatly:
(URL will probably break across the line)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/ad
si/winnt_object_class_hierarchy.asp

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to