smbtree

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

smbtree

Shiran Silviano
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?