SME Server Logon scripts

http://wiki.contribs.org/Smeserver-tw-logonscript

http://forums.contribs.org/index.php?topic=44751.0

http://www.theforcefield.net/forums/index.php?topic=2416.0

http://www.sonoracomm.com/support/18-support/152-login-scripts-sme,

These are some quick notes pertaining to Windows client login scripting for SME 7.

Install the Loginscript Addon

rpm -Uvh http://distro.ibiblio.org/pub/linux/distributions/\
smeserver/contribs/jbennett/sme7/loginscript/RPM/\
smeserver-loginscript-0.2-8.noarch.rpm

then (ignore any error messages):

/etc/e-smith/events/actions/navigation-conf

How to Access and Edit a Logon Script

At a Windows workstation logged into the SME domain as ‘admin’, map a drive letter to the netlogon share:

net use x: \\servername\netlogon

Line Endings

If you use a UNIX editor to create the netlogon.bat file, it is very important to use DOS-style line endings as UNIX editors do not automatically add the carriage-return character required by the Windows logon script processor.

In vi, at the end of the line, hit ctrl-v then ctrl-m. This should insert the desired carriage return to the end of the line.

Alternately, sometime during the editing session, set the file format to DOS mode by hitting ESC to get to command mode, then :set fileformat=dos then :w to write the new format to disk.

Sample netlogon.bat Files

A simple netlogon.bat file:

net time \\servername /set /yes
net use f: \\servername\public /persistent:no
rem net use h: \\servername\%USERNAME% /persistent:no
net use H: /HOME
\\server\public\pccsrv\autopcc

A different netlogon.bat file:

net time \\servername /set /y
net use f: \\servername\public /persistent:no
net use i: \\servername\cdrom /persistent:no
net use j: \\servername\c_drive /persistent:no
net use lpt1: \\servername\cpw /persistent:no
net use lpt2: \\servername\dot /persistent:no
net use lpt3: \\servername\oki /persistent:no

Sonora Comm’s netlogon.bat file supports Win9X:

@echo off
echo.

echo Welcome to the Sonora Comm computer network!
echo --------------------------------------------
echo.
echo Set time to the servers' time...
echo User must be Power User or Administrator under NT/2K/XP!
echo.
net time \\linus /set /yes
echo Map home directory...
echo.
net use h: /home /yes
rem pause

echo Determining if 9X or NT/2K/XP...
echo.
if exist c:\boot.ini goto NOT9X
rem ================== WINDOWS 9X =========================
echo Windows 9X Logon Script

echo.
echo Map drive F:...
set server=\\linus
set drive=f
set newshare=%server%\company
net use %drive%: %newshare%

echo Map drive G:...
set drive=g
set newshare=%server%\acctg
net use %drive%: %newshare%

echo Map Drive P:...
set drive=p
set newshare=%server%\ppc
net use %drive%: %newshare%
rem pause

echo Delete drive Z:...
echo.
net use z: /delete /yes
goto optional

rem ================ WINNT/2000/XP =========================
rem '/persistent:no' is for NT/2000/XP clients only

:NOT9X
echo Windows NT/2K/XP Logon Script
echo.

echo Mapping drive F:
echo.
set drive=f
set newshare=%logonserver%\company
if not exist %drive%:\nul goto no_drive
net use %drive%: /delete /yes
:no_drive
net use %drive%: %newshare% /persistent:no

echo Mapping drive G:
echo.
set drive=g
set newshare=%logonserver%\acctg
if not exist %drive%:\nul goto no_drive1
net use %drive%: /delete /yes
:no_drive1
net use %drive%: %newshare% /persistent:no

echo Mapping drive P:
echo.
set drive=p
set newshare=%logonserver%\ppc
if not exist %drive%:\nul goto no_drive2
net use %drive%: /delete /yes
:no_drive2
net use %drive%: %newshare% /persistent:no

echo Unmap drive Z: if there was one...
if not exist z:\nul goto optional
net use z: /delete /yes

:optional
echo Map network printers...
echo.
net use lpt2: %logonserver%\dot
net use lpt3: %logonserver%\oki
rem pause

@exit
Geplaatst in Linux, Server beheer, SME Server
%d bloggers op de volgende wijze: