#122497 - 2004-07-09 06:45 PM
Basic / Bone head logon script
|
Dellirious
Fresh Scripter
Registered: 2004-07-05
Posts: 5
Loc: NW Ohio
|
When I came here as a new user I was overwhelmed at the extreme complexity of so many of the logon scripts. I just wanted to map a drive and add printers. So here is my boneheaded attempt. Critiques very welcome.
;**** Created with KiXscripts Editor | http://www.adminscripteditor.com/ ****
;**** Last Modified on 7/9/2004 at 12:22:31 PM by ericadmin ****
;**************************************************************************************************
;created by Eric Leszkowicz, you may remove my name and use any of the
;information contained here for your benefit
;MY DOCUMENTS MAPPED TO USER FOLDER USING GPO
;IF THIS IS THE SERVER THEN QUIT
If @WKSTA = "ENTER YOUR SERVER NAME HERE WITHOUT THE \\"
Quit
EndIf
;--Set Workstation Time
SetTime "\\ENTER YOUR SERVER NAME HERE"
;**************************************************************************************************
;This draws a box and allows the user to see all kinds of info
;This may help in diagnosing problems, otherwise the info does not
;have much use.
Box (6,20,17,70,FULL) ; ''the box''
Color w/n
At ( 7,25) "Welcome to ENTER YOUR DOMAIN NAME HERE"
At ( 9,25) "Full name : " ; display some text strings
At (10,25) "Userid : "
At (11,25) "Workstation : "
At (12,25) "Domain : "
At (13,25) "Logon Server : "
At (14,25) "Current Time : "
At (15,25) "Current Date : "
Color w+/n
At ( 9,43) @fullname ; ...and some macro''s
At (10,43) @userid
At (11,43) @wksta
At (12,43) @domain
At (13,43) @lserver
At (14,43) @time
At (15,43) @date
Sleep 4
;**************************************************************************************************
;This sets the M: drive accoording to the group that a user belongs to
;Currently there is no difference, but they are provided as they are in order
;to allow for future changes.
;IN THE BELOW EXAMPLE, YOU SHOULD REPLACE YOURGROUPNAME WITH A GROUP
;IN YOUR DOMAIN. I USE THE /DELETE JUST AS A MEASURE OF INSURANCE
If InGroup ("YOURGROUPNAME")
? "IN GROUP: YOURGROUPNAME"
Use M: /DELETE
Use M: "\\YOUR SERVER NAME\YOUR SHARED FOLDER NAME"
EndIf
If InGroup ("YOURGROUPNAME2")
? "IN GROUP: YOURGROUPNAME2"
Use M: /DELETE
Use M: "\\YOUR SERVER NAME\YOUR SHARED FOLDER NAME"
EndIf
If InGroup ("YOURGROUPNAME2")
? "IN GROUP: YOURGROUPNAME2"
Use M: /DELETE
Use M: "\\YOUR SERVER NAME\YOUR SHARED FOLDER NAME"
EndIf
;**************************************************************************************************
;This first deletes all printer connection and then adds the printer drives according the
;persons work functionality AND location
;LIST ALL printers under the DelPrinterConnection to prevent users from adding printers
;NOTE THAT I DELETE ALL PRINTERS BEFORE I ADD THEM. THIS IS BECAUSE I HAVE USERS THAT
;ARE PRONE TO ADD PRINTERS. IT DOES SLOW DOWN THE LOGIN TIMES.
DelPrinterConnection ("\\YOUR SERVER NAME\YOUR PRINTER NAME")
DelPrinterConnection ("\\YOUR SERVER NAME\YOUR PRINTER2 NAME")
If InGroup ("YOUR GROUP NAME")
AddPrinterConnection ("\\YOUR SERVER NAME\YOUR PRINTER NAME")
AddPrinterConnection ("\\YOUR SERVER NAME\YOUR PRINTER2 NAME")
SetDefaultPrinter ("\\YOUR SERVER NAME\THE NAME OF YOUR PRINTER")
EndIf
;**************************************************************************************************
Edited by Dellirious (2004-07-09 07:25 PM)
_________________________
Love what you do and you will never work a day in your life.
|
Top
|
|
|
|
#122499 - 2004-07-09 07:10 PM
Re: Basic / Bone head logon script
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Is this the same place?
http://www.cbcfindlay.org/
The KiXscripts editor is now located here and has a name change: http://www.adminscripteditor.com/
I have some code to show a pretty logon with Greeting based on time of day if you like I can look it up and post.
|
Top
|
|
|
|
#122501 - 2004-07-09 07:24 PM
Re: Basic / Bone head logon script
|
Dellirious
Fresh Scripter
Registered: 2004-07-05
Posts: 5
Loc: NW Ohio
|
Quote:
Is this the same place?
http://www.cbcfindlay.org/
The KiXscripts editor is now located here and has a name change: http://www.adminscripteditor.com/
I have some code to show a pretty logon with Greeting based on time of day if you like I can look it up and post.
Yes that is the same cbcfindlay. Yes post the code here. That would be great.
Change: removed cbcfindlay and corrected the kixscripts address.
_________________________
Love what you do and you will never work a day in your life.
|
Top
|
|
|
|
#122502 - 2004-07-09 07:26 PM
Re: Basic / Bone head logon script
|
Dellirious
Fresh Scripter
Registered: 2004-07-05
Posts: 5
Loc: NW Ohio
|
Quote:
Just an aside, is setting the wkstn time in the login script still an advisable thingy (to do) - even on NT, user's needed settime priv to do this, and under XP/AD not required (afaik) and can even mess things up (iirc). Anybody ?
I had wondered about that myself. I have 98 and NT systems running for the "time" being. No errors yet here, but wonder what the potential problems could be?
_________________________
Love what you do and you will never work a day in your life.
|
Top
|
|
|
|
#122505 - 2004-07-09 11:53 PM
Re: Basic / Bone head logon script
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
No I was not saying to modify the TIME, but simply a display a GREETING different depending on the time of day for the logon.
I'll look it up later on at home tonight and post if I find it. I've not used it now for over a year as all my logon scripting is not completely silent - NO 9x boxes anymore.
|
Top
|
|
|
|
#122506 - 2004-07-10 01:23 AM
Re: Basic / Bone head logon script
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Okay, here is the code example I was talking about if you going to show the user the logon script actions.
Note: This requires KiXtart 4.x prefferably v4.22 or newer.
Code:
CLS SMALL Color b+/n BOX (0,0,24,79,GRID) ; background grid Color b/n BOX (2,3,13,77,Å) ; shadow of the box Color g+/n BOX (1,2,12,76,FULL) ; Green box Color b+/n Select Case ((@TIME > "00:00:00") And (@TIME < "12:00:00")) AT(9,5) "Good Morning @fullname" AT(10,5) "You are entering the @domain domain." Color r+/n AT(11,5)"Please wait - Network authentication is being verified . . ." Color b+/n Case ((@TIME > "12:00:00") AND (@TIME < "18:00:00")) Color b+/n AT(9,5) "Good Afternoon @fullname" AT(10,5) "You are entering the @domain domain." Color r+/n AT(11,5)"Please wait - Network authentication is being verified . . ." Color b+/n Case 1 AT(9,5) "Good Evening @fullname" AT(10,5) "You are entering the @domain domain." Color r+/n AT(11,5)"Please wait - Network authentication is being verified . . ." Color b+/n EndSelect Color w+/n AT (2,5) "Userid : " ; label for user and network identification text strings AT (3,5) "Full Name : " AT (4,5) "Workstation : " AT (5,5) "NT Domain : " AT (6,5) "Logon Server : " AT (7,5) "OS : " AT (8,5) "Service Pack : "
Color y+/n AT (2,20) @userid ; macro's for user and network identification text strings AT (3,20) @fullname AT (4,20) @wksta AT (5,20) @domain AT (6,20) @lserver ; Lists the authenticating server AT (7,20) @ProductType AT (8,20) @CSD AT (11,65) ; Moves the cursor to the end of the message
|
Top
|
|
|
|
#122507 - 2004-07-10 07:08 PM
Re: Basic / Bone head logon script
|
Dellirious
Fresh Scripter
Registered: 2004-07-05
Posts: 5
Loc: NW Ohio
|
Like that additional stuff for the login. I will incorporate some of that into my login.
Concerning 9x users. I should have no more 9x computers in a week or two, so I am only focusing on NT users.
_________________________
Love what you do and you will never work a day in your life.
|
Top
|
|
|
|
#122509 - 2004-07-11 05:12 PM
Re: Basic / Bone head logon script
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Also, if memory serves, there is a specific permission you can set for setting time on a workstation.
Kent
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|