I use a common logon script when a user logs in. The assignment of a home directory is done within smb.conf by using the %U parameter, but I don't see a way to pass that name to the script. Is it possible for the Samba logon script to know the ID of the user who is currently logging in? If so, how is it done? Thank you. *** Steve Snyder ***
Steve Snyder wrote:> > I use a common logon script when a user logs in. The assignment of a home > directory is done within smb.conf by using the %U parameter, but I don't > see a way to pass that name to the script. > > Is it possible for the Samba logon script to know the ID of the user who is > currently logging in? If so, how is it done?Don't think this is possible in a batch file. Check out Kixtart from http://netnet.net/~swilson/kix.html or I believe now included in the NT4 resource kit? It's a login script processor with access to lots of system type variables and a whole lot more. Cheers Martin -- Martin Sapsed Tel: +44 (0)1248 382409 Computing Lab Fax: +44 (0)1248 383826 University of Wales, Bangor m.sapsed@bangor.ac.uk North Wales, LL57 2DG Unexpected Application Error: (A)bort, (R)etry, (G)et a beer.
> Is it possible for the Samba logon script to know the ID of the user who is > currently logging in? If so, how is it done? >On the logon script in my samba based network i have the following lines of code net config /yes | gawk "/^Nome utente/ { print $3 }" | get ze > NULL set userid=%get% echo userid: %userid% The windows '95 "net config /yes" command gives you some information about your network; for example (i am using the italian version of Windows '95): C:\> NET CONFIG Nome computer \\EUCLIDE # computer name Nome utente VALERIO # user name Gruppo di lavoro SANSALVO # workgroup Directory princ. workstation C:\WINDOWS # workstation main dir Versione del software 4.00.950 # software version Versione del redirector 4.00 # redirector version I parse the output of this command using gawk and put the username in an environment variable using the very old but useful get utility. (I haven't URL address for this utilities at hand, but you can search for them on the web). Bye Valerio Di Giampietro LAN & Unix System Administrator Magneti Marelli - Divisione Macchine Rotanti Zona Industriale 66050 S. Salvo (CH) - Italy --------------------------------------------------------- Phone : +39-873-388-646 Fax : +39-873-388-602 E-Mail: VDiGiampietro@sansalvo.marelli.it Web : http://www.webcom.com/vdg