This is Bavaria, Germany!
There are some things to do while logging
into a Domain with WindowsNT:
The following Script does all this. It works with Kixtart, a scripting language for Windows which supports a lot of useful things, i.e.:
and a loooot of things more.
Newest version of Kixtart always can be found at http://www.xs4all.nl/~akhw/winnt.htm
or here
on my own server (Version 3.35 from March, 17th 1997).
If you want to create logonscripts with Perl/Win32 try this...
; file : logon.scr
; version: 1 from 16th of March 1997
; author : Richard Lippmann
;
; objective: - even mapping of drives for all users in lan
; - even mapping for people in a group
; - adding of PATH for people in a group
;
; requirements:
; 1. script was tested under winnt4/german
; 2. you must have these files under %SYSTEMROOT%\system32\repl\import\scripts
; - KIX32.EXE, at least V3.35 (kix32 /?)
; - KX32.DLL
; and this file
; 3. call this script in the profile of usrmgr for each user like this:
; kix32 logon.scr
;
;
;
;
; SYNC LOCAL TIME
SETTIME "LENA"
; ============== show login info ===================================
; REM DISPLAY BOX FOR ADMINISTRATORS
small
COLOR b+/n
BOX (0,0,24,79,GRID)
COLOR b/n
BOX (8,16,21,71,GRID)
COLOR g+/n
BOX (7,15,20,70,FULL)
; REM DISPLAY NT VARIABLE NAMES
Color w+/n
AT ( 9,20) "Userid : "
AT (10,20) "Full name : "
AT (11,20) "Description : "
AT (12,20) "Privilege : "
AT (13,20) "Workstation : "
AT (14,20) "Address : "
AT (15,20) "Domain : "
AT (16,20) "Logon Domain : "
AT (17,20) "Logon Server : "
; REM DISPLAY NT VARIABLES
Color y+/n
AT ( 9,35) @userid
AT (10,35) @fullname
AT (11,35) @comment
AT (12,35) @priv
AT (13,35) @wksta
AT (14,35) @address
AT (15,35) @domain
AT (16,35) @ldomain
AT (17,35) @lserver
COLOR w/n
AT (19,20) "Wait for 2 seconds."
SLEEP 1
CLS
; ============== mappings fuer all users ==================================
; homedirectory is \\lena\lippmann$$
$server="\\lena"
$user=@userid
$homeflag="$$"
; there are no homedrives at this site
; USE H: "$server\$user\$homeflag"
use g: "$server\public"
use t: "$server\tmp"
; ============== mappings for groupmembers ===========================
$ingruppe="oracleuser"
$newdrive="L"
$share="homelisa"
if ingroup($ingruppe)
; connect, also if there was another drivemapping (overwrite)
use $newdrive: "$server\$share"
else
; delete possible mapping for non-members of group
; (if wanted)
if exist ("$newdrive:\nul")
use $newdrive: /delete
endif
endif
$ingruppe="wwwadmin"
$newdrive="W"
$share="www"
if ingroup($ingruppe)
; connect, also if there was another drivemapping (overwrite)
use $newdrive: "$server\$share"
else
; delete possible mapping for non-members of group
; (if wanted)
if exist ("$newdrive:\nul")
use $newdrive: /delete
endif
endif
use list
; ============= add PATHvariable for groupmembers ===============
;
; add PATHvariable
; as seen in a script of eegleston@tsmi.iitri.com
; in http://netnet.net/~swilson/kix/ed.html
;
$ingruppe="oracleuser"
$addpath="d:\temp"
if ingroup($ingruppe)
? "user is in group $ingruppe, add $addpath to PATH"
else
? "user is not in group $ingruppe: I do not change PATH"
goto ENDE_PFAD_ORACLE
endif
; here are the registrykeys for PATH
$regpathloc="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\"
$regpathloc=$regpathloc+"Session Manager\Environment"
$dummy=ExistKey($regpathloc)
if @ERROR <> 0
? "Sanity Check: Registrypath for PATH does not exist... "
? "PATH kann nicht erweitert werden."
else
? "Sanity Check: Registrypath for PATH exists... good!"
$orgpath=Readvalue($regpathloc,"Path")
; ? "PATH = $orgpath"
; does the directory to add already exists in PATH?
$ex=INSTR($orgpath,$addpath)
if $ex > 0
; ? $addpath is already there
else
$newpath=$orgpath+";$addpath"
$dummy=WriteValue($regpathloc,"Path",$newpath,"REG_EXPAND_SZ")
if @ERROR=0
? "PATH was expanded by $addpath"
else
? "PATH could not be expanded by $addpath!"
endif
endif
endif
:ENDE_PFAD_ORACLE
; ========== change screensaver and make it password-protected ============
;
; secure screensaver so it's switching on after $sstimeout seconds
; work on only with enter of password
? "change screensaver to secure..."
$RegSSLoc="HKEY_CURRENT_USER\Control Panel\Desktop"
$dummy=ExistKey($RegSSLoc)
if @ERROR <> 0
? "SanityCheck: Desktop Key does not exist, "
? "cannot change screensaver to secure mode"
else
; screensaver after 60 seconds
$sstimeout=60
; ? "SanityCheck: Desktop Key exists"
$ssact=Readvalue($RegSSLoc,"ScreenSaveActive")
$sssec=Readvalue($RegSSLoc,"ScreenSaverIsSecure")
$sstim=Readvalue($RegSSLoc,"ScreenSaveTimeOut")
$ssact=Readvalue($RegSSLoc,"ScreenSave.Exe")
$dummy=WriteValue($RegSSLoc,"ScreenSaveActive","1","REG_SZ")
if @ERROR=0
? "Screensaver is active."
else
? "Could not activate screensaver."
endif
$dummy=WriteValue($RegSSLoc,"ScreenSaverIsSecure","1","REG_SZ")
if @ERROR=0
? "Screensaver ist password protected."
else
? "Screensaver could not be changed to be password protected."
endif
$dummy=WriteValue($RegSSLoc,"ScreenSaveTimeOut","$sstimeout","REG_SZ")
if @ERROR=0
? "Screensaver is active after $sstimeout seconds."
else
? "I could not set screensaver timeout."
endif
endif
|
Very good login-scripts to look on provides Steve Wilson at
http://netnet.net/~swilson/kix/ed.html.
Take a look at this page when you like to write loginscripts
without Kixtart.
| last modified: August 18, 2003 |
|