Page 2 of 4 <1234>
Topic Options
#55537 - 2001-05-08 08:29 PM Re: Modular Logon Script
Anonymous
Unregistered


Hey Bryce, I wanna say thanks for the idea, and great code here. I've completed my version, taken back to 3.62. I've modified alot of the way it works, including the ini file functionality. Instead of declaring OS and user groups in the run order section, you can declare any number of them in each modular section so that you can run each piece for any combination of users computers and domains. The coolest piece I made is a GUI editor in VB that will view and edit the ini file very easily. It's very cool, but it's completely designed for my company. I have all of this zipped and can send it to anybody who wants to look at it. I don't have anywhere to post it.

Later,
Aerathi

Top
#55538 - 2001-05-08 08:30 PM Re: Modular Logon Script
Anonymous
Unregistered


Oh, I forgot. If you want me to send it to you, email me at watsonr@msx.upmc.edu
Top
#55539 - 2001-05-08 09:35 PM Re: Modular Logon Script
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Nice!

I got the file you sent me. And it gave me a couple more ideas... (do you mind if I put it the web site for others to DL?)

I am going to implement your idea for multiple group membership rules for the groupcode() function.

I have made a number of changes to this script (just haven't updated yet )


  • I got am email (i can't recall who sent it to me so step forward please!) stating a concern about possible slow performance with many people accessing the config.ini file.
    The logon script now does a date check on the config.ini and if it is new, config.ini is imported into the registry. All data is pulled from the reg location of config.ini.

  • Added better support of macros and variables in the config.ini

  • and other general tweaking

Bryce

------------------
kix.isorg.net

Top
#55540 - 2001-05-08 09:45 PM Re: Modular Logon Script
Anonymous
Unregistered


Sure, you can post it. I did notice the problem with drag, when I tested it on a couple machines grabbing it off the server. That's a good idea to fix it, I'll have to look into that. Did you get a chance to look at the .ini editor I made for it?

Top
#55541 - 2001-05-09 08:48 PM Re: Modular Logon Script
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
yea I looked at the INI editor....very nice! That is what I had in mind, or something like that


Here is a link to DL Aerathi's script http://kix.isorg.net/other_scripts/AdminScripts/ModLogon%20by%20Aerathi.zip

Bryce

------------------
kix.isorg.net

Top
#55542 - 2001-05-11 12:19 AM Re: Modular Logon Script
Anonymous
Unregistered


I've made a few changes to my version of Bryce's mod logon script. Actually the changes were in the ini editor. The copy I previously sent was a read only version because I didn't have all the code complete for writing to the ini file. It can now read, write, add modules, and change the run order of the modules. The ini file is not real clean after being used by this exe, but it does work properly (at least so far). I did have to make one minor change to my logon.kix file. I added stops for each piece (i.e. OS, user group, domain, etc.) so that if a blank value is read in no more values of that type beyond the blank value will be considered. I did this because I could not delete lines from the .ini with my editor, just write to them. So now if I went through and set up a module in the editor to only run on win95 machines, it will write the following to the .ini file:

OperatingSystem1 = Win95
OperatingSystem2 =

This way, if previously there were three allowed operating systems, then the third would still be listed, but will not work because the logon script will quit checking once it hits the blank value. I have these changes, plus the source for my vb ini editor if anyone wants it. I'm going to email them to Bryce in case he wants to post it.

Top
#55543 - 2001-06-19 09:42 PM Re: Modular Logon Script
Anonymous
Unregistered


This modular login script is pretty sweet...just one problem that I can't seem to get by. I am trying to use this on NT 4 and Win2k clients. Everything is sweet on the NT 4 clients, but the script window won't open on the win2k clients. Any suggestions?

Thanks in advance...

Top
#55544 - 2001-06-27 06:18 PM Re: Modular Logon Script
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Please keep in mind that this logon script is not 100% finished yet Still have a few bugs to fix and sections that need fleshing out (adjusting the path on win9x computers is really broken at the moment!).

What do you mean by not running under win2k systems? The script runs but is minimized at the bottom of the screen?

Bryce

------------------
kix.isorg.net

Top
#55545 - 2002-01-24 02:57 PM Re: Modular Logon Script
RalphG Offline
Fresh Scripter

Registered: 2002-01-14
Posts: 11
Loc: CH
hello all

I have a, well for you it must be just to stupid, problem with the "Kix_Logon_script" from bryce...

I started using KiX a while ago, and did a, for me, quit impressive login script, drive mapping (based on the groups), do some checks based on registry entries, silent installations of missing apps and of course, some nice messages for the user ;-)

so far so good, because of the growing complexity to handle everything in one script - I'm trying to adopt the verry helpfull script of bryce to my needs...

but I'm already stuck at the beginning:
when I Unzip the script
- where do I have to place all those files and directories ?!?

- where lies the logon.kix after running logon.bat

- for user login -> I have to point him to "logon.bat" instead of kix32 mylogin.kix - right ?!?

I see what's going on in the scripts (and even understand it but I can't get the enviroment work ...

cheers

.Ralph

---------------

uhoh - think I found it ! RTFM !
those " %0\..\ " are clear now, more or less

another thing is, what's the difference between kix32c.exe and kix32.exe ?!?

[ 24 January 2002: Message edited by: RalphG ]

Top
#55546 - 2002-01-28 11:25 PM Re: Modular Logon Script
Stephen Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 13
First of all let me start by saying these scripts rock.. WHO"S HOUSE??? Bryce's HOUSE!!. Ok now that that has been said. I wanted to add a module to the script that would automatically create icons on the desktop. I did this in another script.. but I'm trying to be slick and "modulerize" it. .. it's almost there.. but it seems like it isn't pushing the values correctly to the functions.. let me layout the steps I took to add my module

1) added Module9 = All|G!Domain Users|Create_icons to the [Module_run_order]section of the ini
2) created the [Create_icons] section in the ini with the following in it.

;set status to ON if you want to run this Module
status = on

;set the TotalActions to equal the total number of drive mappings actions
TotalActions = 3

; The Create Icon entires should be in this format.
; please see logon-readme.txt for a full explanation on "OS type" and "Group membership".
; action# = OS Type | Group Membership | path | targetpath | arguments | working location | iconpath | window style

action1 = all|G!Domain users|%userprofile%\desktop\Groupwise 5.lnk|C:\novell\groupwise\grpwise.exe|/@@u-?|C:\novell\groupwise||
action2 = all|G!Domain users|%userprofile%\desktop\Forms.lnk|http://intranet.mhcuc.org/forms/forms.htm|||F:\APPS\ICONS\doc04.ico|
action3 = all|G!MASONICDATABASE|%userprofile%\desktop\Masonic Database.lnk|f:\data\sri\masonic.mdb||F:\DATA\SRI||7

3) Create create_icons.kix in the module folder with the following in it:

; this is the drive mapping routine.
; 0| 1| 2| 3| 4| 5| 6| 7
; OS| Group Membership | path | targetpath | arguments | working location | iconpath | window style
; action1 = all|GDomain Admins|\\Houston\admin|w:

DIM $ModuleData, $TotalActions, $actions

$totalActions = val(readvalue("$ConfigRegkey\$Module","TotalActions"))

? "Creating Icons"
for $action = 1 to $totalActions

$moduledata = split(readvalue("$ConfigRegkey\$Module","action$action"),"|")

select
case Ubound($moduledata) <> 7
? "There is an error in the Config.ini file"
case OS($Moduledata[0]) = 1 AND GroupCode($moduledata[1]) = 1
$nul = WshShortCut($moduledata[2],$moduledata[3],$moduledata[4],$moduledata[5],$moduledata[6],$moduledata[7])
endselect
Next
Exit(0)

4) Added the following function to kix_ functions.kix:

Function WshShortCut($path,$targetpath,optional $arguments, optional $startdir, optional $iconpath, optional $style)
dim $shell,$shortcut,$icosep,$ifile,$iindex
$shell = createobject("wscript.shell")
if $shell
$shortcut = $shell.createshortcut("$path")
if $shortcut $shortcut.targetpath = $targetpath
if $arguments $shortcut.arguments = $arguments endif
if $startdir $shortcut.workingdirectory = $startdir endif
if $iconpath $shortcut.iconlocation = $iconpath endif
if $style $shortcut.windowstyle = $style endif
$shortcut.save
if instr("$path",".url") and $iconpath
$icosep=instr("$iconpath",",")
if $icosep>0
$ifile=left("$iconpath",instr("$iconpath",",")-1)
$iindex=right("$iconpath",len("$iconpath")-$icosep)
else
$ifile=$iconpath
endif
$=writeprofilestring("$path","InternetShortcut","IconFile","$ifile")
$=writeprofilestring("$path","InternetShortcut","IconIndex","$iindex")
endif
$shortcut = 0
endif
$shell = 0
endif
exit @error
EndFunction

As part as my testing I put (but removed it before I pasted it here) ? statements in the module and function that printed the values to see if it was picking up them up like it was suppose to. What I found was that the module was getting the values but the function looked like it only got the first letter of the values. Please help..

Stephen

P.S. Hopefully my cut and pastes aren't to ugly.

_________________________
Big dogs take Big Bites

Top
#55547 - 2002-01-29 12:13 AM Re: Modular Logon Script
Stephen Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 13
I figured out why it not working(my previous post), but not how to fix it. It doesn't like %userprofile%. It doesn't translate it like it was suppose to. It litterly try's to use "%userprofile%" which doesn't exist. Can anyone help me with this? What am I doing wrong?

Stephen

btw: I also added these lines to the function:

if instr($path,"~") <> 0 $path = Fillvariable($path) endif
if instr($targetpath,"~") <> 0 $targetpath = Fillvariable($targetpath) endif
if instr($arguments,"~") <> 0 $arguments = Fillvariable($arguments) endif
if instr($startdir,"~") <> 0 $startdir = Fillvariable($startdir) endif
if instr($iconpath,"~") <> 0 $iconpath = Fillvariable($iconpath) endif
if instr($style,"~") <> 0 $style = Fillvariable($style) endif

they seem to help!

_________________________
Big dogs take Big Bites

Top
#55548 - 2002-01-29 12:21 AM Re: Modular Logon Script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Stephen,
ExpandEnvironmentVars( )

{edit}
Ha! short, sweet, and faster than Shawn!

[ 29 January 2002: Message edited by: LLigetfa ]

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#55549 - 2002-01-29 12:22 AM Re: Modular Logon Script
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Stephen,

Might want to try this little known, not documented in the html help files function. Its called:

EXPANDENVIRONMENTVARS

Action:

Expands any environment variables inside a string to the corresponding value.

Syntax:

EXPANDENVIRONMENTVARS ("string")

Parameters:

String
The string you want to expand.

Returns:

The expanded string.

Example:

$Value = ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlset\Control\Windows", “SystemDirectory” )

? ExpandEnvironmentVars( $Value )

Hope this helps!

Bryce does rock, doesn't he !

-Shawn

Top
#55550 - 2002-01-29 01:02 AM Re: Modular Logon Script
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
ohh, i will have to take a closer look at this when i get home tonight....

When i wrote this script i had to have been in the Kix "zone" or something, because looking at it now... i am thinking... I wrote this?

Bryce

Top
#55551 - 2002-01-29 01:07 AM Re: Modular Logon Script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
yup yup yup... know that feeling all too well.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#55552 - 2002-01-31 04:53 PM Re: Modular Logon Script
RalphG Offline
Fresh Scripter

Registered: 2002-01-14
Posts: 11
Loc: CH
hello all

it's me again....

after getting deeper in the script (clapclap again for bryce)

I still have troubles to get it running...

it starts, copies the ini, copies the other files, does the registry entries... and next thing is -> press any key to continue...

it doesn't start a single module... and I still haven't inserted my own modules ;-)

I test ist on a W2K Professional Workstation...

any hints ?!?

cheersio

.Ralph

Top
#55553 - 2002-01-31 05:21 PM Re: Modular Logon Script
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
hmmm.... check the config.ini or post just the [Module_run_order] part of it here.

Bryce

Top
#55554 - 2002-02-01 10:30 AM Re: Modular Logon Script
RalphG Offline
Fresh Scripter

Registered: 2002-01-14
Posts: 11
Loc: CH
here we go....

at the moment everything is placed on a network drive g:\ (which already exists)

that's the start command in the batch file

code:
 G:\Kix_Logon_script\KIX32.EXE %1 G:\Kix_Logon_script\logon.KIX $runpath=G:\Kix_Logon_script\ /d 

and that's the config.ini

code:
 [Module_run_order]
;Module Library
ModuleLib = modules\

;Set TotalModuleNumber to equal the total number of Modules
TotalModuleNumber = 8

; you can specify by OS Type and Group Membership, to run only specific Modules
; please see logon-readme.txt for a full explanation on "OS type" and "Group membership".
; Modue# = OS Type | Group Membership | Module

Module1 = all|g!Domain Admins|CTRL_C
Module2 = all|G!Domain Users|legal_notice
Module3 = all|G!Domain Users|Welcome
Module4 = all|G!Domain Users|PWExpire
Module5 = all|G!Domain Users|Set_Clock
Module6 = ALL|G!Domain Users|Drives
module7 = ALL|G!Domain Users|Path
Module8 = All|G!Domain Users|Other_scripts

[ctrl_c]
;set status to ON if you want to run this Module
status = off
break = on

[legal_notice]
;set status to ON if you want to run this Module
status = ON
force = yes
notice = "You are loggin on to PEAK Technologies Computer network.|Only authorised personell are allowed to access this system."

[welcome]
;set status to ON if you want to run this Module
status = ON
timeout = 5
welcome = "Welcome to PEAK Technologies (Schweiz) AG|have a nice day||we really mean it!!"

[PWexpire]
;set status to ON if you want to run this Module
status = off

;X number of days till Password Expire(start showing a notice)
days2PWE = 5

;how old a pasword is allowed to get
PWE = 90

;message box timeout
timeout = 10

[set_clock]
;set status to ON if you want to run this Module
status = ON
timeserver = \\CHSVR1

[drives]
;set status to ON if you want to run this Module
status = ON

;set the TotalActions to equal the total number of drive mappings actions
TotalActions = 19

; The drive mapping entires should be in this format.
; please see logon-readme.txt for a full explanation on "OS type" and "Group membership".
; action# = OS Type | Group Membership | UNC path | Drive letter

action1 = NTx|G!PEAK|\\chsvr1\~@userid~$|h:
action2 = NTx|G!PEAK|\\CHSVR1\Kunden|k:
action3 = NTx|G!PEAK|\\CHSVR1\Lieferanten|l:
action4 = NTx|G!PEAK|\\CHSVR1\Marketing|m:
action5 = NTx|G!PEAK|\\CHSVR1\Applikationen|o:
action6 = NTx|G!PEAK|\\CHSVR1\Projekt|p:
action7 = NTx|G!PEAK|\\CHSVR1\Sales|s:
action8 = NTx|G!PEAK|\\CHSVR1\Services|u:
action9 = NTx|G!PEAK|\\CHSVR1\Allgemein|w:
action10 = NTx|G!PEAK|\\CHSVR1\Abacus|z:
action11 = NTx|G!bc_Kader|\\CHSVR1\Kader|n:
action12 = NTx|G!bc_Controlling|\\CHSVR1\Controlling|t:
action13 = NTx|G!bc_Admin|\\CHSVR1\Admin|j:
action14 = NTx|G!DEVELOPMENT|\\CHSVR1\Development|r:
action15 = all|G!PEAK|\\Barsrvnt001\SRV-CD|x:
action16 = all|G!PEAK|\\Chmailsrv1\Kompass|y:
action17 = Win9x|G!domain users|\\CHSVR1\SERVICES|O:
action18 = all|G!Domain Admins|\\CHSVR1\IT|f:
action19 = all|G!Domain Admins|\\CHSVR1\IT-ADMIN$|g:

;action20 = all|G!traffic|\\houston\sysr_traffic|i:
;action21 = all|G!Finance|\\houston\r58g_finance|k:
;action22 = all|G!Imports|\\houston\r58g_imports|k:
;action23 = all|G!Programming|\\houston\r58g_prog|p:
;action24 = all|G!Adv-bus|\\houston\Vol1|n:
;action25 = all|G!Adv-bus|\\houston\vol1_oasis|o:
;action26 = all|G!Return_Checks|\\return_checks\collect|r:
;action27 = all|G!Loss_prevention|\\houston\LP|L:
;action28 = all|G!Store Operation|\\houston\store|o:
;action29 = NT|I!128.2.0.0/255.255.0.0|\\houston\blat|o:
;action30 = off|G!?-usr|\\houston\sv00~$customvar1~|o:

[Path]
;This is where you can tell your logon script add or remove statments from the Path
;set status to ON if you want to run this Module
status = off

;Set TotalActions to equal the total number of Actions
TotalActions = 4

; you can specify by OS Type and Group Membership, to add or remove the selected paths
; please see logon-readme.txt for a full explanation on "OS type" and "Group membership".
; action# = OS Type | Group Membership | A!path to add
; action# = OS Type | Group Membership | R!path to remove

action1 = NT|G!Domain Admins|a!w:\ntreskit
action2 = win2k|G!Domain Admins|a!w:\w2kreskit
action3 = NTx|G!Domain Admins|a!w:\ntsec
action4 = off|G!Domain Admins|a!w:\ntsec


[Other_Scripts]
;This is where you can tell your logon script launch other KiXtart scripts
;set status to ON if you want to run this Module
status = on

:Script library
ScriptLib = scripts\

;Set TotalActions to equal the total number of Scripts actions
TotalActions = 2

; you can specify by OS Type and Group Membership, to run only specific Scripts
; please see logon-readme.txt for a full explanation on "OS type" and "Group membership".
; action# = OS Type | Group Membership | script name

action1 = all|G!Domain users|hotfixchecker.kix
action2 = NTx|G!Domain users|abacus.kix
;action1 = all|G!Domain users|inventory.kix
;action2 = all|G!Domain users|xmas.kix
;action3 = win9x|G!Domain users|mcafee.kix



Top
#55555 - 2002-02-01 04:31 PM Re: Modular Logon Script
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
the g: drive stuff can be changed back to %0\..\ and everything will still work.

2nd, when you unzipped the file you did unzip all of the folders too?

if unzipped properly, you should have a directory folder like this (I have the logon script in the "c:\logon" folder for testing).

code:
C:\logon>dir /s/b
C:\logon\Applications
C:\logon\config.ini
C:\logon\Functions
C:\logon\kix32.exe
C:\logon\kx16.dll
C:\logon\KX32.dll
C:\logon\KX95.dll
C:\logon\Logon-ReadMe.txt
C:\logon\logon.bat
C:\logon\logon.kix
C:\logon\Modules
C:\logon\Scripts
C:\logon\wkix32.exe
C:\logon\Applications\winset.exe
C:\logon\Functions\Custom_Variables.kix
C:\logon\Functions\kix_functions.kix
C:\logon\Modules\ctrl_c.kix
C:\logon\Modules\Drives.kix
C:\logon\Modules\Legal_Notice.kix
C:\logon\Modules\Module_template.kix
C:\logon\Modules\Other_Scripts.kix
C:\logon\Modules\Path.kix
C:\logon\Modules\pwexpire.kix
C:\logon\Modules\set_clock.kix
C:\logon\Modules\welcome.kix
C:\logon\Scripts\inventory.kix
C:\logon\Scripts\mcafee.kix
C:\logon\Scripts\xmas.kix

3rd, call the logon.bat with a /d "logon.bat /d" this will launch kix in debug mode

Bryce

Top
#55556 - 2002-02-22 05:43 PM Re: Modular Logon Script
Anonymous
Unregistered


Hey bryce, this is a great modular script! I tested it and it works great, thanks However, I have a couple of questions. I have been testing it under administrator and everything is working ok. However, testing it under a normal user doesn't seem to work. Is it because it doesn't have rights to edit the registry?
Top
Page 2 of 4 <1234>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 202 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.072 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org