code:
;**** ****
;**** Login script for Lorentzen & Stemoco ****
;**** Made 21-22 Sep 2002 by Sverre Munthe ****
;**** Copyright (c) 2002, Lorentzen & Stemoco ****
;**** This script will only work with WinNT or better ****
;**** ****
;**** MunSve 27.09.2002 Added support for Symantec live update ****
;**** MunSve 29.09.2002 Something wrong with copying ls.bmp ****
;**** MunSve 29.09.2002 WinXP machines don't get @primarygroup ****
;**** ****
;****
;**** Setting a few variables for the script
;****
setoption("hidecursor", "on")
settitle("Hi " +@fullname + " you are now being logged on to Lornet, please wait this shouldn't take long")
if ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync") <> 1
$value = WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync", "1", "REG_DWORD")
endif
;****
;**** Checking if this is the first time this machine
;**** has logged on to the domain, if it is a file is
;**** created and a line is made about the logon time,
;**** if it isn't a line is made in the file about time
;****
$firsttime = 0
$file = "%0\..\Users\" + @userid + ".log"
if open(1, $file, 4) <> 0
if open(1, $file, 5) = 0
$txt = writeline(1, "First time logged on to domain " + @date + " " + @time + @crlf)
$firsttime = 1
endif
else
$txt = writeline(1, "Logged on to domain from workstation " + @wksta + " " + @date + " " + @time + @crlf)
endif
;****
;**** Making a welcome message if this is the first time
;****
if $firsttime=1
Small
Color b+/n
Box (0,0,24,79,GRID)
Color g/w+
Box (0,9,24,70,FULL)
Color n/w+
AT (1,11) " Welcome to the Lornet domain! "
AT (3,11) " Since this is the first time you are logging on we will "
AT (4,11) " take some time informing you about the Lornet domain as "
AT (5,11) " well as what we in the IT-department can help you with. "
AT (7,11) " The domain Lornet consists of 6 servers that all work "
AT (8,11) " together to give you the best working solution possible "
AT (9,11) "The file-server is where you will save your work and also"
AT (10,11) " run some of your more special programs from "
AT (11,11) "The Exchange-server is where all the e-mail is collected."
AT (12,11) "The MRS-server collects all the e-mail from the Exchange-"
AT (13,11) " server and also receives faxes. "
AT (14,11) " The SQL-server collects, and stores, all the messages "
AT (15,11) " for the Strategic software from the MRS-server. "
AT (16,11) " The Terminal-server lets you work from outside the Oslo "
AT (17,11) " office without having the programs installed on the PC. "
AT (18,11) " The Shipnet-server stores all of the post-fixtures. "
AT (20,11) "If you have any problems with any of the programs or your"
AT (21,11) "PC, we at the IT-department will do our best to help you."
AT (22,11) " You can reach us at 777 during working hours and at 888 "
AT (23,11) " after working hours. From outside dial 22 52 78 88. "
Color g/w+
AT (24,28) "Press a key to continue"
do
until kbhit()
endif
;****
;**** Testing for certain specific dates
;****
$array = @mdayno, @monthno
$today = join($array, "/")
if $today = "1/1" $specialday = "Happy New Year!"
endif
if $today = "1/5" $specialday = ""
endif
if $today = "17/5" $specialday = "Gratulerer med dagen Norge!"
endif
if $today = "24/12" $specialday = "Merry Christmas!"
endif
if $today = "25/12" $specialday = "Merry Christmas!"
endif
if $today = "31/1" $specialday = ""
endif
;****
; **** This next string is for testing
;****
;if $today = "22/9" $specialday = "Some type of text"
;endif
if len($specialday) > 0
Small
$length = len($specialday)
$x1 = ((79 - $length) / 2) - 1
$x2 = 79 - $x1
Color b+/n
Box (0,0,24,79,GRID)
Color b/n
Box (11,$x1+1,15,$x2+1,Å)
Color g/w+
Box (10,$x1,14,$x2,FULL)
Color n/w+
AT (12,$x1+2) $specialday
sleep 3
endif
;****
;**** Adjusting the clock to same as server
;****
SetTime "\\lorfile"
;****
;**** Making a box that shows some data about
;**** his/her machine and the network
;****
$mhz = ""
$mhz = $mhz + @mhz + "MHz"
$diskspace = getdiskspace("c:\")
$diskspace = int($diskspace/1000)
if len($diskspace) > 3
$length = len($diskspace) - 3
$diskspace = left($diskspace, $length) + "." + right($diskspace,3) + "MB"
else
if len($diskspace) < 2
$diskspace = "Harddisk full!"
else
$diskspace = $diskspace + "MB"
endif
endif
Small
Color b+/n
Box (0,0,24,79,GRID)
Color b+/n
Box (6,21,19,61,Å)
Color g/w+
Box (5,20,18,60,FULL)
Color b/w+
AT ( 7,25) "Userid : "
AT ( 8,25) "Full name : "
AT ( 9,25) "Group : "
AT (10,25) "Privilege : "
AT (11,25) "Workstation : "
AT (12,25) "CPU speed : "
AT (13,25) "C-drive : "
AT (14,25) "Domain : "
AT (15,25) "Logon Server : "
AT (16,25) "Current Time : "
Color n/w+
AT ( 7,40) @userid
AT ( 8,40) @fullname
AT ( 9,40) @primarygroup
AT (10,40) @priv
AT (11,40) @wksta
AT (12,40) $mhz
AT (13,40) $diskspace
AT (14,40) @domain
AT (15,40) @lserver
AT (16,40) @time
color w+/w+
;AT (0,0)
Sleep 5
;****
;**** Deleting all nettwork drives and setting
;**** up new ones
;****
Use "*" /delete
$f = "\\lorsql\visma"
$g = "\\lorfile\programs"
$h = "\\lorfile\software"
$i = "\\lorfile\c$"
$j = "\\lorfile\d$"
$k = "\\lorfile\download"
$l = "\\lorfile\drivers"
$m = "\\lorfile\kixtart"
$n = "\\lorfile\netlogon"
$o = "\\lorfile\z"
$s = "\\lorfile\shared"
$u = "\\lorfile\@userid"
$v = "\\lorfile\@primarygroup"
$w = "\\lorfile\departments"
Use f: $f
Use g: $g
Use h: $h
Use s: $s
Use u: $u
Use v: $v
Use w: $w
;****
;**** If you are a domain admin it also sets
;**** up a few more network drives
;****
:Domain_admins
If InGroup ("Domain admins")
Use i: $i
Use j: $j
Use k: $k
Use l: $l
Use m: $m
Use n: $n
Use o: $o
EndIf
;****
;**** Everyone in the Oslo office has access to
;**** these printers
;****
:Printers_for_OSLO
If InGroup ("l_gr_all")
AddPrinterConnection ("\\lorfile\admin")
AddPrinterConnection ("\\lorfile\colorlaser")
EndIf
;****
;**** One group for each printer (default printer)
;**** Each person can only be in one group so
;**** additional printers must be defined here
;****
:Printers_for_IKT
If InGroup ("p_gr_ikt")
AddPrinterConnection ("\\lorfile\ikt")
If SetDefaultPrinter ("\\lorfile\admin")=0
EndIf
EndIf
:Printers_for_OPS
If InGroup ("p_gr_ops1")
AddPrinterConnection ("\\lorfile\ops1")
If SetDefaultPrinter ("\\lorfile\ops1")=0
EndIf
EndIf
If InGroup ("p_gr_ops2")
AddPrinterConnection ("\\lorfile\ops2")
If SetDefaultPrinter ("\\lorfile\ops2")=0
EndIf
EndIf
If InGroup ("p_gr_ops3")
AddPrinterConnection ("\\lorfile\ops3")
If SetDefaultPrinter ("\\lorfile\ops3")=0
EndIf
EndIf
If InGroup ("p_gr_ops4")
AddPrinterConnection ("\\lorfile\ops4")
If SetDefaultPrinter ("\\lorfile\ops4")=0
EndIf
EndIf
:Printers_for_DRY
If InGroup ("p_gr_dry1")
AddPrinterConnection ("\\lorfile\dry1")
If SetDefaultPrinter ("\\lorfile\dry1")=0
EndIf
EndIf
If InGroup ("p_gr_dry2")
AddPrinterConnection ("\\lorfile\dry2")
If SetDefaultPrinter ("\\lorfile\dry2")=0
EndIf
EndIf
If InGroup ("p_gr_dry3")
AddPrinterConnection ("\\lorfile\dry3")
If SetDefaultPrinter ("\\lorfile\dry3")=0
EndIf
EndIf
If InGroup ("p_gr_dry4")
AddPrinterConnection ("\\lorfile\dry4")
If SetDefaultPrinter ("\\lorfile\dry4")=0
EndIf
EndIf
:Printers_for_SandP
If InGroup ("p_gr_sandp1")
AddPrinterConnection ("\\lorfile\sandp1")
If SetDefaultPrinter ("\\lorfile\sandp1")=0
EndIf
EndIf
If InGroup ("p_gr_sandp2")
AddPrinterConnection ("\\lorfile\sandp2")
If SetDefaultPrinter ("\\lorfile\sandp2")=0
EndIf
EndIf
:Printers_for_NBOff
If InGroup ("p_gr_nboff")
AddPrinterConnection ("\\lorfile\nboff")
If SetDefaultPrinter ("\\lorfile\nboff")=0
EndIf
EndIf
:Printers_for_TANK
If InGroup ("p_gr_tank")
AddPrinterConnection ("\\lorfile\tank")
If SetDefaultPrinter ("\\lorfile\tank")=0
EndIf
EndIf
:Printers_for_GAS
If InGroup ("p_gr_gas")
AddPrinterConnection ("\\lorfile\gas")
If SetDefaultPrinter ("\\lorfile\gas")=0
EndIf
EndIf
:Printers_for_ADMIN
If InGroup ("p_gr_admin2")
AddPrinterConnection ("\\lorfile\admin2")
If SetDefaultPrinter ("\\lorfile\admin2")=0
EndIf
EndIf
If InGroup ("p_gr_admin3")
AddPrinterConnection ("\\lorfile\admin3")
If SetDefaultPrinter ("\\lorfile\admin3")=0
EndIf
EndIf
:Printers_for_ACCOUNT
If InGroup ("p_gr_account")
AddPrinterConnection ("\\lorfile\account")
If SetDefaultPrinter ("\\lorfile\account")=0
EndIf
EndIf
:Printers_for_RESEARCH
If InGroup ("p_gr_research")
AddPrinterConnection ("\\lorfile\research")
If SetDefaultPrinter ("\\lorfile\research")=0
EndIf
EndIf
;****
;**** Copying necessary files for Symantec Live Update
;**** And setting necessary registry key
;****
Copy "%0\..\liveupdt.hst" "c:\program files\symantec\liveupdate\"
Copy "%0\..\s32luhl1.dll" "c:\program files\symantec\liveupdate\"
WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\Symantec\LiveUpdate\Preferences","All Transports Available","0","REG_DWORD")
;****
;**** Checking if screensaver is active
;**** If not, new screensaver is set
;****
$dir = ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows NT\currentversion", "SystemRoot")
Copy "%0\..\ls.bmp" $dir
$scrsvr = $dir + "\ls.bmp"
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive","1","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveTimeOut","600","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","SCRNSAVE.EXE",$dir + "\system32\ss3dfo.SCR","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DFlyingObj","Texture",$scrsvr,"REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DFlyingObj","Size","100","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DFlyingObj","Tesselation","200","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DFlyingObj","Type","6","REG_SZ")
;****
;**** Checking if the homepage on IE is our official
;**** If not, http://www.lorstem.com is set
;****
:IE_Start_Page
$home=ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page")
If $home<>"http://www.lorstem.com"
Goto Set_Home_Page
Else
Goto end
EndIf
:Set_Home_Page
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page","http://www.lorstem.com","REG_SZ")
;****
;**** Flushing all keystrokes
;****
flushkb
:END
Exit