|
|
|||||||
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 ;************************************************************************************************** |
||||||||
|
|
|||||||
Looks good to me. One thing - you should "silence" your function calls, so that funky 0's (zeros) dont get displayed to your nicely formatted login window, have you noticed them ? Silence them (all) like this: $rs = DelPrinterConnection ("\\YOUR SERVER NAME\YOUR PRINTER NAME") |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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 ? |
||||||||
|
|
|||||||
Quote: Yes that is the same cbcfindlay. Yes post the code here. That would be great. Change: removed cbcfindlay and corrected the kixscripts address. |
||||||||
|
|
|||||||
Quote: 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? |
||||||||
|
|
|||||||
re: setting the time - Win9x is one thing, NT another and tbh we still set the system time on the user's behalf under NT. But under XP and in AD - remember reading that MS suggests you NOT set the time in fact, depending, it can cause authentication issues under AD - just wondered thats all. |
||||||||
|
|
|||||||
One more thing - I always thought AddPrinterConnection didn't/doesn't work under Win9x, are your 9x users immune to this by virtue of group membership, or maybe you should build in some more IF checking around the OS ? -Shawn |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
SETTIME requires SetSystemTime or Power User privileges, thus shouldn't be used in login scripts. Also, under NT/2000/XP/2003 it is recommended to use the Windows Time service. SETTIME would only be necessary for Windows 9x support. |
||||||||
|
|
|||||||
Also, if memory serves, there is a specific permission you can set for setting time on a workstation. Kent |
||||||||
|
|
|||||||
...but the permission to set time is restricted for a reason. Users should not have permission to change system time. That should be done by the NOS. AD is very sensitive to bad time and so takes care of the time automagically. |
||||||||
|
|
|||||||
Kent: that is the SetSystemTime security permission. However, one should really use the time service for this. |