Can the logon script know username?
Valerio Di Giampietro
valerio at sansalvo.marelli.it
Mon Feb 22 14:46:28 GMT 1999
> 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 at sansalvo.marelli.it
Web : http://www.webcom.com/vdg
More information about the samba
mailing list