smbtree
Shiran Silviano <[email protected]> Tue, 26 Jan 2016 17:58:19 +0200
| Newsgroups | gmane.network.samba.java |
|---|---|
| Message-ID | <CAEHs9BWe=qSLN-gfghM0eS_SQCBr6vkYS2WykiE9t5Pz1z5UHQ@mail.gmail.com> |
--001a1143b7e614a479052a3ec18c
Content-Type: text/plain; charset=UTF-8
Hi,
I try to get the smbTree list - (all computers in the lan ) by this code:
SmbFile[] domains = (new SmbFile("smb://",a)).list();
for (int i = 0; i < domains.length; i++) {
SmbFile[] servers = domains[i].listFiles();
for (int j = 0; j < servers.length; j++) {
System.out.println("\t" + servers[j].getPath());
}
}
When the domain is secured i get this exception:
jcifs.smb.SmbAuthException: Logon failure: unknown user name or bad
password.
The ubuntu terminal command - "smbtree" returns the list of all the
computers in my lan.
Is there a way to get the computer's list with jcifs?
--001a1143b7e614a479052a3ec18c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"rtl"><div style=3D"text-align:left" dir=3D"ltr">Hi,</div><div s=
tyle=3D"text-align:left" dir=3D"ltr">I try to get the smbTree list - (all c=
omputers in the lan ) by this code:</div><div style=3D"text-align:left" dir=
=3D"ltr"><div dir=3D"ltr"><br></div><div dir=3D"ltr"><br></div><div dir=3D"=
ltr"><span class=3D"" style=3D"white-space:pre"> </span>SmbFile[] domains=
=3D (new SmbFile("smb://",a)).list();</div><div dir=3D"ltr"><spa=
n class=3D"" style=3D"white-space:pre"> </span>for (int i =3D 0; i < d=
omains.length; i++) {</div><div dir=3D"ltr"><span class=3D"" style=3D"white=
-space:pre"> </span>SmbFile[] servers =3D domains[i].listFiles();</div><=
div dir=3D"ltr"><span class=3D"" style=3D"white-space:pre"> </span>for (=
int j =3D 0; j < servers.length; j++) {</div><div dir=3D"ltr"><span clas=
s=3D"" style=3D"white-space:pre"> </span>System.out.println("\t&qu=
ot; + servers[j].getPath());</div><div dir=3D"ltr"><span class=3D"" style=
=3D"white-space:pre"> </span>}</div><div dir=3D"ltr"><span class=3D"" st=
yle=3D"white-space:pre"> </span>}</div><div><span style=3D"white-space:pr=
e">When the domain is secured i get this exception:</span></div><div><span =
style=3D"white-space:pre">jcifs.smb.SmbAuthException: Logon failure: unknow=
n user name or bad password.
</span></div><div>The ubuntu terminal command - "smbtree" returns=
the list of all the computers in my lan.</div><div><br></div><div>Is there=
a way to get the computer's list with jcifs?=C2=A0</div></div></div>
--001a1143b7e614a479052a3ec18c--