Koozali.org: home of the SME Server

logon scripts

Taylor

logon scripts
« on: February 23, 2002, 04:06:01 AM »
I am new to e-smith, I am used to NT servers. I have a functional e-smith server, I have it set up a Domain controller (for lack of the better word) In NT you can set up a logon script that will do a lot of useful things. Is there some kind of similar feature with e-smith? If so I would appreciate any links or how-to's. The reason I ask is because I have several machines that logon to the "domain" but I need to map some "home drives" or other user/group related "mapped drives". All your help would be greatly appreciated!

~Taylor

Des Dougan

Re: logon scripts
« Reply #1 on: February 23, 2002, 08:20:07 AM »
There is a non-browsable share called "netlogon" on the server. This includes a simple sample netlogon.bat file.

I've created a more complex version which I've pasted below and which will do what you seem to be asking. To use it fully, you'll need to grab "winset.exe" from a Win 95 CD and do a Google search for "putinenv.exe".

Good luck,

Des Dougan


@echo off
REM
REM Enhanced version by Des Dougan (ddougan@telus.net), March 2001.
REM
REM Updated to add code to enable use on NT/W2K, November 2001.
REM
REM Updated to fix some errors in the code to enable use on NT/W2K.
REM These caused some problems on Win 9x systems. February 2002.
REM
REM **Windows 9x/ME systems**
REM This enhanced "netlogon.bat" script uses "winset" (an MS
REM utility which is on the Win95 CD (not sure about 98 or ME). It
REM loads environment variables extracted by "putinenv".
REM "putinenv" is a freeware utility used to read samba system variables.
REM Note: it does not pull all the variables noted in its online help
REM presumably because samba does not support all the MS LAN Manager
REM variables this was written to extract.
REM
REM **NT/Win 2000**
REM NT and W2K don't need, and can't use, "winset". Code included to
REM bypass the Win9x required stuff.
REM
REM Main code starts here
REM
REM Set the temporarily-mapped directory containing the scripts.
Z:\
REM Define the name of the server this batch file runs from. Server
REM name is in "\servername" format.
REM
set SERVER=\agatha
REM
REM Set the workstation time when clients logon to the domain.
REM
net time %SERVER% /set /yes
REM
REM Map the user's home directory to drive H:
net use h: /home /yes
REM
REM Map the testing shared directory tree to drive T:
REM
net use t: %SERVER%\testing /yes
REM
REM Bypass Win9x-specific section if NT/W2K (NT & W2K have a "boot.ini"
REM file, which Win9x doesn't have).
REM
if exist c:\boot.ini goto :NOT9X
REM
REM For Win 9x clients, define the name of the server this batch file
REM runs from as a global ("winset") environment variable. Server
REM name is in "\servername" format.
REM
winset SERVER=\agatha
REM
REM Run the putinenv utility to extract variables
REM Run "putinenv | more" for help
REM
putinenv.exe L /L
REM
REM Set the USERNAME environment variable
REM
winset USERNAME=%USERNAME%
REM
REM Set COMPUTERNAME if required
REM winset COMPUTERNAME=%COMPUTERNAME%
REM
:NOT9X
REM
REM Set shares based on who's logging in
REM if "%USERNAME%"=="des" net use q: %SERVER%\quicken /yes
REM
REM Set the directory back to C:\
REM
C:\
REM
REM Delete Z:\mapping (left behind by NT and Win 2K)
REM
net use z: /delete /yes

Taylor

Re: logon scripts
« Reply #2 on: February 23, 2002, 09:02:02 PM »
Des Thanks again! With your help and a little tweaking i got it all to work!! For anyone else out there with the same problem this really does work.
Plus the logon script he provides is a great template!

~Taylor

Craig

Re: logon scripts
« Reply #3 on: February 26, 2002, 05:54:45 PM »
Des

I noticed on the Dev Info Forums a zip file of logon script commands etc that was floating around. Do you have that file or any other info on all the commands available for logon scripts for Samba.

Could you email or post any information that you have.

Thanks in advance.

Regards
Craig

Des Dougan

Re: logon scripts
« Reply #4 on: February 27, 2002, 09:11:12 AM »
Craig wrote:
> I noticed on the Dev Info Forums a zip file of logon script
> commands etc that was floating around. Do you have that file
> or any other info on all the commands available for logon
> scripts for Samba.
>

Craig,

It wasn't quite a list of logon script commands, but the netlogon.batch file plus the two other files I mentioned in the earlier posting in this thread. To get a list of available standard commands, type "net help", and more specifically, "net help use".

Des Dougan

Tom Veitch

Re: logon scripts
« Reply #5 on: February 27, 2002, 10:10:39 AM »
I Have just started useing KIx for login scrips its great

Craig

Re: logon scripts
« Reply #6 on: February 27, 2002, 12:31:46 PM »
Des

Not a problem I wasn't quite sure I am aware of the net commands. Its always nice to see how other people do it.

Regards
Craig

Hans Pedersen

Re: logon scripts
« Reply #7 on: March 07, 2002, 02:49:37 PM »
Today, I just started experimenting with the SME Server 5.12. Maybe, if things turns out the way I expect them to, SME in time will replace our current Windows NT 4 Server.

Today I use Kixtart for logon scipt, and the thing you mention there seems to be pretty much alike. Maybe it even is Kixtart?? Please tell me about it!

Hans