Achim Gottinger
2013-Nov-09 22:51 UTC
[Samba] Enumeratings shares on Samba (3/4) servers with vbs
Hi, Working on an login script here for my samba4 servers. I try to get an list of the shares on server with this vb code. Set shares = GetObject("WinNT://SERVER/LanmanServer") For Each s In shares WScript.Echo s.Name Next The code works fine against Windows 2003/2008 R2. But if SERVER is an Samba Server (tested 3.6.x/4.0.10) i get an group not found error. Other this like printer enumeration works Set printers = GetObject("WinNT://SERVER,Computer") printers.Filter=Array("PrintQueue") For Each p In printers WScript.Echo p.Name Next Do i have to add some config to my smb.conf to get the LanmanServer queries resolved? Thanks in advance achim~
Achim Gottinger
2013-Nov-10 02:29 UTC
[Samba] Enumeratings shares on Samba (3/4) servers with vbs [Solved by workaround]
Am 09.11.2013 23:51, schrieb Achim Gottinger:> Hi, > > Working on an login script here for my samba4 servers. I try to get an > list of the shares on server with this vb code. > > Set shares = GetObject("WinNT://SERVER/LanmanServer") > > For Each s In shares > > WScript.Echo s.Name > > Next > > The code works fine against Windows 2003/2008 R2. But if SERVER is an > Samba Server (tested 3.6.x/4.0.10) i get an group not found error. > > Other this like printer enumeration works > > Set printers = GetObject("WinNT://SERVER,Computer") > > printers.Filter=Array("PrintQueue") > > For Each p In printers > > WScript.Echo p.Name > > Next > > Do i have to add some config to my smb.conf to get the LanmanServer > queries resolved? > > Thanks in advance > achim~ > >Seems VB is blind when it comes to query shares no samba servers. The only alternativ is using "net view". Found an working solution with autoit3 however.
Volker Lendecke
2013-Nov-19 20:24 UTC
[Samba] Enumeratings shares on Samba (3/4) servers with vbs
On Sat, Nov 09, 2013 at 11:51:46PM +0100, Achim Gottinger wrote:> Hi, > > Working on an login script here for my samba4 servers. I try to get > an list of the shares on server with this vb code. > > Set shares = GetObject("WinNT://SERVER/LanmanServer") > > For Each s In shares > > WScript.Echo s.Name > > NextIt seems that this vbs code assumes that we run the RPC services we offer on smb named pipes also on TCP. With a pure source3 based file server this is not the case. Can you send network traces running this code against us and against 2003? Thanks, Volker -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen http://www.sernet.de, mailto:kontakt at sernet.de