Thomas.Hansen.tmh./Copenhagen@manbw.dk
1998-Jun-24 13:11 UTC
Check if the PC is either NT or Win95
HI Samba users, Is there any way, that I from the unix command line, can start either smbclient or another program to check what kind the PC is, i.e. in a script I would like to know if the client is a NT or W95. I was told smbclient could do it, but I cannot get it to work. Thomas
Thomas.Hansen.tmh./Copenhagen@manbw.dk wrote:> > HI Samba users, > > Is there any way, that I from the unix command line, can start either > smbclient or another program to check what kind the PC is, i.e. in a > script I would like to know if the client is a NT or W95. I was told > smbclient could do it, but I cannot get it to work. > > > > > ThomasIf you run smbclient -L <machine name> -U% you will get a line like the following on NT machines: Domain=[ENGR] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0] On Win95 and Win98 clients you will not get an OS= entry. -- =====================================================================Herb Lewis Silicon Graphics Technical Marketing 2011 N Shoreline Blvd Network Systems Division Mountain View, CA 94043 herb@sgi.com Tel: 650-933-2177 http://www.sgi.com Fax: 650-932-2177 ======================================================================
Thomas.Hansen.tmh./Copenhagen@manbw.dk
1998-Jun-26 11:59 UTC
Check if the PC is either NT or Win95
Hi Herb, I found out that if you set debug level to 0, there lines are omitted: Added interface ip=150.166.97.31 bcast=150.166.97.255 nmask=255.255.255.0 Server time is Thu Jun 25 08:15:55 1998 Timezone is UTC-7.0 Password: Domain=[ENGR] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0] security=user Thanks for you help. Thomas ______________________________ Reply Separator _________________________________ Subject: Re: Check if the PC is either NT or Win95 Author: herb (herb@chomps.engr.sgi.com) at internet Date: 25-06-98 18:15 Thomas.Hansen.tmh./Copenhagen@manbw.dk wrote:> root@hpcs7:/home/root #smbclient -L sv1a -U addcomp -W DIESEL -P 12345678 > unrecognized character set > Unable to copy service - source not found: > Password: > > Server=[SV1A] User=[] Workgroup=[DIESEL] Domain=[] > > Sharename Type Comment > --------- ---- ------- > A Disk > ADMIN$ Disk Remote Admin > C Disk > C$ Disk Default share > IPC$ IPC Remote IPC > TEMP Disk > > What version of samba are you running? > Any idears? >I am running 1.9.18p8 but this has worked on all the 1.9.18 versions at least and maybe 1.9.17 as well. Do you have the correct codepage installed on the samba machine? Earlier versions of samba had a very limited set of code pages that it recognized. Also check the character set parameter. Here is the code that generates the second message. void interpret_character_set(char *str) { if (strequal (str, "iso8859-1")) { init_iso8859_1(); } else if (strequal (str, "iso8859-2")) { init_iso8859_2(); } else if (strequal (str, "iso8859-5")) { init_iso8859_5(); } else if (strequal (str, "koi8-r")) { init_koi8_r(); } else { DEBUG(0,("unrecognized character set\n")); } } Here is the section from the smb.conf.5 man page character set (G) This allows a smbd to map incoming characters from a DOS 850 Code page to either a Western European (ISO8859-1) or Eastern European (ISO8859-2) code page. Normally not set, meaning no filename translation is done. Default character set Example character set = iso8859-1 Here is what the output should look like on an NT machine herb@chomps:/ > smbclient -L tigra -W engr -U herb Added interface ip=150.166.97.31 bcast=150.166.97.255 nmask=255.255.255.0 Server time is Thu Jun 25 08:15:55 1998 Timezone is UTC-7.0 Password: Domain=[ENGR] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0] security=user Server=[TIGRA] User=[] Workgroup=[ENGR] Domain=[] Sharename Type Comment --------- ---- ------- ADMIN$ Disk Remote Admin C$ Disk Default share D$ Disk Default share E Disk ZIPDRIVE IPC$ IPC Remote IPC Personal Disk Here is the output from a Win98 machine herb@chomps:/ > smbclient -L herbnt2 -W herbnt -U herb Added interface ip=150.166.97.31 bcast=150.166.97.255 nmask=255.255.255.0 Server time is Thu Jun 25 09:07:04 1998 Timezone is UTC-7.0 security=share Server=[HERBNT2] User=[] Workgroup=[HERB-NT] Domain=[HERB-NT] Sharename Type Comment --------- ---- ------- C Disk CDROM Disk D Disk IPC$ IPC Remote Inter Process Communication By the way, the -P option is used to connect as a printer so you do not need it. If you have the source installed on your machine and also have perl 5 you may want to take a look at a script I have in packaging/SGI directory called findsmb. This will list all machines that respond on a subnet (see the comments at the beginning for how to run). -- ====================================================================== Herb Lewis Silicon Graphics Technical Marketing 2011 N Shoreline Blvd Network Systems Division Mountain View, CA 94043 herb@sgi.com Tel: 650-933-2177 http://www.sgi.com Fax: 650-932-2177 ======================================================================