Google групе више не подржавају нове Usenet постове ни праћења. Претходни садржај остаје видљив.

computer names and samba shares

44 прегледа
Пређи на прву непрочитану поруку

Josef Dalcolmo

непрочитано,
15. 6. 2004. 06:31:3815.6.04.
Hello,

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).

Tim Golden

непрочитано,
16. 6. 2004. 03:59:5916.6.04.
– Josef Dalcolmo, pytho...@python.org

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:

1) NET VIEW

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

2)
http://tgolden.sc.sabren.com/python/win32_how_do_i/list_machines_in_a_domain
.html

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.

TJG


________________________________________________________________________
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:
http://www.star.net.uk
________________________________________________________________________

Josef Dalcolmo

непрочитано,
16. 6. 2004. 05:24:0416.6.04.
on Wed, 16 Jun 2004 08:59:59 +0100
Tim Golden <tim.g...@viacom-outdoor.co.uk> wrote:

> http://tgolden.sc.sabren.com/python/win32_how_do_i/list_machines_in_a_domain
> .html

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

Thanks - Josef Dalcolmo

Josef Dalcolmo

непрочитано,
16. 6. 2004. 05:27:4416.6.04.

Let's try a bit better: we have a Samba server and a local net: netmask 255.255.255.0 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

Tim Golden

непрочитано,
16. 6. 2004. 05:42:2016.6.04.
– Josef Dalcolmo, pytho...@python.org
| Let's try a bit better: we have a Samba server and a local
| net: netmask 255.255.255.0 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.

ADSI is (in essence) Windows' answer to LDAP.
If your Samba / Windows network were set up
to use Active Directory (AD), you could use an LDAP
client to query AD from any machine, Windows, Linux,
or anything else. If it doesn't (and it doesn't need
to) you're down to other methods.

If you want specific code to run from Windows
boxes, I'm quite happy to supply various alternatives.
On the Samba front, I'm afraid, you'll have to
Google / ask around.

| 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.

Understood. I can come up with several solutions using
several Windows-only approaches. Without that, though,
I think you need to ask some Samba experts about Samba
tools.

In particular, I think that "smbclient -L <host>" will
show the shares on any Samba-like box (Linux or Win32).
And the "NET VIEW <host>" will do the same from any
Win32 box. "NET VIEW" is one of a set of command-line
tools on Win32 boxes which you run from the command
prompt. "NET VIEW" on its own will list all machines
known to the machine you're on. With a host name, it
will list visible shares on that host.

Tim Golden

непрочитано,
16. 6. 2004. 05:59:1316.6.04.
– Josef Dalcolmo, pytho...@python.org
| 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.

There is also pysmb, which I've never tried, but
which seems to be up-to-date:

http://miketeo.net/projects/pysmb/

Josef Dalcolmo

непрочитано,
16. 6. 2004. 09:18:5316.6.04.
on Wed, 16 Jun 2004 10:59:13 +0100
Tim Golden <tim.g...@viacom-outdoor.co.uk> wrote:

> http://miketeo.net/projects/pysmb/

This seems to do what I was looking for. Thanks for the tips.

Best regards - Josef

0 нових порука