Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: computer names and samba shares

Thread Tools

RE: computer names and samba shares

Tim Golden
Posts: n/a
| can anyone tell me how to find the list of computer names on
| a samba network, and
| the list of shared folders / devices on a samba networked computer?
| We have a GNU/Debian Server, and I am trying to do it first
| from a Win2000 machine (though ideally, the code should be
| platform-independent).

The meaning of "the list of computer names on a samba network"
is not terribly well defined, but taking the request at face
value, there are several possibilities:


(From NET HELP VIEW) "When used without options, [NET VIEW]
displays a list of computers in the current domain or network."


This uses the WinNT: object under Windows.

There are other options, using the win32net code, Active Directory (either
via ADSI objects or via LDAP), and the Samba equivalent to NET VIEW (check
the Samba docs for that), but an amount depends on exactly what you're
after and whether you're trying to get.


__________________________________________________ ______________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
__________________________________________________ ______________________

Reply With Quote
Josef Dalcolmo
Posts: n/a
on Wed, 16 Jun 2004 08:59:59 +0100
Tim Golden <(E-Mail Removed)> wrote:

> .html

ok, works now I have overlooked, that the .html got wrapped

Thanks - Josef Dalcolmo
Reply With Quote
Josef Dalcolmo
Posts: n/a

Let's try a bit better: we have a Samba server and a local net: netmask on 192.168.0.x (no proxies or so between me and this net). We do not have LDAP, yellow pages etc. though there is a DNS server. Network addresses are static (for now).

I don't know what ADSI is, we do not use LDAP.

I was hoping to find a platform-independent solution in Python, because some machines in the company use GNU/Linux, which means win32net is of limited use.

Listing computers on a domain was the first part of my question. I would
be even more interested to find out about the second part: listing Samba
(Windows) shares on the Samba server (program running on a client machine).

os.listdir(r'//myserver') doesn't work, because '//myserver' is not a directory. I guess I should look at the Samba docs, but was hoping there is already a library for Python ...

Best regards - Josef Dalcolmo

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
os.path.exists() and Samba shares BDZ Python 5 08-06-2009 09:57 PM
ASP.NET 2.0 site accessing Samba 3 shares Michael D. Ober ASP .Net 1 09-28-2006 09:27 PM
samba/windows shares I.V. Aprameya Rao Python 1 12-10-2004 10:10 AM
samba/windows shares I.V. Aprameya Rao Python 0 12-09-2004 02:34 PM
computer names and samba shares Josef Dalcolmo Python 0 06-15-2004 10:31 AM