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.