Work with Windows workgroups under Python?

K

Karlo Lozovina

I'm running Python 2.4 under WinXP Pro, and I would like to do some basis
operations on my LAN - get list of workgroups, list the computers in each
workgroup and possibly connect to specific computer and get
share/directory list? Is there some Pythonic way of doing this? Or any
other less Pythonic way?

Thanks...
 
J

Jarek Zgoda

Karlo Lozovina napisa³(a):
I'm running Python 2.4 under WinXP Pro, and I would like to do some basis
operations on my LAN - get list of workgroups, list the computers in each
workgroup and possibly connect to specific computer and get
share/directory list? Is there some Pythonic way of doing this? Or any
other less Pythonic way?

You can get these things from ActiveDirectory. Google for that, there is
even wrapper module for querying AD server.
 
M

Mondal

Hi,

Active Directory is available under NTFS only. If you are running on
the older FAT32, use the win32wnet and win32netcon modules in *Active
Python 2.4*.

You can use the WNetOpenEnum and WNetEnumResource functions in
nested-for-loops to walk through the Network root to the lowest level
of shareable folders, passing through workgroups and hosts.

Regards
 
H

Heiko Wundram

Karlo said:
Is there some Pythonic way of doing this?

If you need to query for workgroups from pure Python (because you're running
under Linux, for example), search the web for the source package of PySMB.
That's a pure Python implementation of (parts of) the SMB protocol. It has
been abandoned by it's author, as it seems, but IIRC the last version I
used worked like a charm for exactly what you're trying to do with it.

--- Heiko.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top