Scripts - Page 2 - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 02-02-2006, 11:35 PM   #11 (permalink)
Monster Techie
 
Join Date: Sep 2005
Posts: 1,319
Default

hmm thats more of sharing the file....

i just want the login script...its diffrent...
__________________

__________________

Avalanch3 is offline  
Old 02-03-2006, 06:57 PM   #12 (permalink)
Techie Beyond Description
 
Osiris's Avatar
 
Join Date: Jan 2005
Location: Kentucky
Posts: 36,817
Send a message via ICQ to Osiris Send a message via AIM to Osiris Send a message via MSN to Osiris Send a message via Yahoo to Osiris
Default

Here is our login script
--------------------------------------------
@echo off
Echo ArvinMeritor Logon Script

VER | find "NT" > nul
IF not errorlevel 1 GOTO Win_NT

VER | find "2000" > nul
IF not errorlevel 1 GOTO Win_NT

VER | find "XP" > nul
IF not errorlevel 1 GOTO Win_NT

VER | find "98" > nul
IF not errorlevel 1 GOTO Win_9X

VER | find "95" > nul
IF not errorlevel 1 GOTO Win_9X

VER | find "5.2.3790" > nul
IF not errorlevel 1 GOTO Win_NT


GOTO unknown_os

:win_NT
IF EXIST %WINDIR%\KIX32.EXE CALL %WINDIR%\KIX32.EXE %logonserver%\netlogon\KIXTART.KIX && GOTO END
IF NOT EXIST %WINDIR%\KIX32.EXE COPY %logonserver%\netlogon\KIX\K*.* %windir%\
CALL %WINDIR%\KIX32.EXE %logonserver%\netlogon\KIXTART.KIX
GOTO END


:win_9X
IF EXIST %WINDIR%\KIX32.EXE CALL %WINDIR%\KIX32.EXE %0\..\KIXTART.KIX
IF NOT EXIST %WINDIR%\KIX32.EXE CALL %0\..\KIX\KIX32.EXE %0\..\KIXTART.KIX

:unknown_os
:end
----------------------------------------------------------------------------

Which calls this:
---------------------------------------------------------------------------

;**** Created with KiXscripts Editor | http://KiXscripts.com ****
;**** Last Modified on 8:35 AM 1/30/2006 by kendaljl****

; ***********************************************
; * BODY OF COMMON LOGON SCRIPT *
; ***********************************************

; SetOption( “DisableDebugging”, “On”) ; comment this out to enable debug
; debug on ; remove the comment to enable debug


Gosub DISPLAY_INFO
; GOSUB DISCOVER_SERVER
Gosub OPTIMIZE_SCRIPT
Gosub CHECK_NETSPEED
Gosub SYNCHRONIZE_TIME
Gosub DISCOVER_SMS
Gosub DISCOVER_FPSERVER
;GOSUB FixSA
;GOSUB PATCH
Gosub MAP_DRIVES
GoSub MAP_HYPERION_DRIVES

; ***********************************************
; * IF THIS IS NOT A TERMINAL SERVER LOGON... *
; * OR AN IIS SERVER IN THE WEB FARM LOGON... *
; ***********************************************
If InStr(@WKSTA, "TS") <> 4 AND InStr(@WKSTA, "IS") <> 4 AND InStr(@WKSTA, "WF") <> 4 AND InStr(@WKSTA, "MM") <> 4
Gosub INSTALL_SMS
EndIf

Gosub CALL_SITE_LS

Exit 0







; ***********************************************
; * FORMAT THE CONSOLE WINDOW DISPLAY AREA AND *
; * DISPLAY USER ACCOUNT & SESSION INFORMATION *
; ***********************************************
ISPLAY_INFO

Small
Color b+/n
Box (0,0,24,79,GRID) ; 'background grid'
Color b/n
Box (6,24,23,61,Å) ; 'shadow' of the box
Color g+/n
Box (5,23,23,60,FULL)

Color w+/n
AT ( 7,25) "Userid : "
AT ( 8,25) "Full name : "
AT ( 9,25) "Privilege : "
AT (10,25) "Workstation : "
AT (11,25) "Domain : "
AT (12,25) "Logon Server : "
AT (13,25) "Password Age : "

Color y+/n
AT ( 7,40) @USERID
AT ( 8,40) @FULLNAME
AT ( 9,40) @PRIV
AT (10,40) @WKSTA
AT (11,40) @DOMAIN
AT (12,40) @LSERVER
AT (13,40) @PWAGE
AT (24,79)

Return



; ***********************************************
; * Discover Server Operating Systems *
; ***********************************************
ISCOVER_SERVER

If InStr(@PRODUCTTYPE, "Server")
AT (16,25) "Server Operating System Detected, Exiting Script"
Sleep 5
Quit 0
EndIf

Return



; ***********************************************
; * OPTIMIZING LOGON SCRIPT FOR SLOW NETWORKS *
; ***********************************************
:OPTIMIZE_SCRIPT

Color w+/n
If Exist ("%WINDIR%\KIX32.EXE") = 0
AT (16,25) "Optimizing Logon Script Process"
AT (24,79)
Copy "@SCRIPTDIR\kix\KIX32.EXE" "%WINDIR%\KIX32.EXE"
Copy "@SCRIPTDIR\kix\KX16.DLL" "%WINDIR%\KX16.DLL"
Copy "@SCRIPTDIR\kix\KX32.DLL" "%WINDIR%\KX32.DLL"
Copy "@SCRIPTDIR\kix\KX95.DLL" "%WINDIR%\KX95.DLL"
Else
AT (16,25) "Logon Script has been Optimized"
AT (24,79)
EndIf

Return



; ***********************************************
; * CHECK FOR SLOW NETWORK CONNECTION <128K BPS *
; ***********************************************
:CHECK_NETSPEED

Color w+/n
AT (17,25) "Testing Network Connection Speed"
AT (24,79)

Shell "@LSERVER\NETLOGON\slwnt32 @LSERVER\NETLOGON\ 80000"
If @ERROR = 0
$NETSPD = "FAST"
Goto HOPSKIP
Else
$NETSPD = "SLOW"
EndIf


; ************************************************
; * Now check and see if RAS is installed, and *
; * then check to see if a RAS session is open...*
; ************************************************
$RAS = "NO"
If ( Exist ("%WINDIR%\SYSTEM32\RASAPI32.DLL") > 0 ) OR ( Exist ("%WINDIR%\SYSTEM\RASAPI32.DLL") > 0 )
If Exist ("%WINDIR%\CHECKRAS.EXE") = 0 Copy "@LSERVER\NETLOGON\SMS\CHECKRAS.EXE" "%WINDIR%\CHECKRAS.EXE" EndIf
Shell "%WINDIR%\CHECKRAS.EXE"
If @ERROR = 1
$RAS = "YES"
Else
$RAS = "NO"
EndIf
EndIf

; ************************************************
; * If a RAS session is open, treat this as a *
; * SLOW network connection... *
; ************************************************
:HOPSKIP
If $RAS = "YES" $NETSP = "SLOW" EndIf

AT (17,25) "Network Connection Speed is "
Color y+/n "$NETSPD"
AT (24,79)

Return



; ***********************************************
; * SYNCHRONIZE LOCAL MACHINE WITH LOGONSERVER *
; ***********************************************
:SYNCHRONIZE_TIME

SetTime "@LSERVER"

Return



; ***********************************************
; * DISCOVER USER'S SMS ENVIRONMENT *
; ***********************************************
ISCOVER_SMS

Color w+/n
AT (17,25) "Detecting SMS Environment"
AT (24,79)

$SMSSERVER = ""
$SMS2=0
;IF SUBSTR(@IPADDRESS0, 1, 12) = " 10. 69.247." $SMS2=0 $SMSSERVER="TRYSMS001"ENDIF
If SubStr(@IPADDRESS0, 1, 12) = "161. 63.170." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63.171." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63.172." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63.173." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63.174." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63.175." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63.202." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
;If SubStr(@IPADDRESS0, 1, 12) = "161. 63.138." $SMS2=1 $SMSSERVER="TRYSMS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 64.254." $SMS2=1 $SMSSERVER="SPAADS001"EndIf
If SubStr(@IPADDRESS0, 1, 8) = " 10. 15." $SMS2=1 $SMSSERVER="CITSMS001"EndIf
;If Substr(@IPADDRESS0, 1, 8) = " 10. 14." $SMS2=0 $SMSSERVER="CONADS001"ENDIF
;If Substr(@IPADDRESS0, 1, 8) = " 10. 8." $SMS2=0 $SMSSERVER="GLDADS001"ENDIF
If SubStr(@IPADDRESS0, 1, 12) = "161. 63. 67." $SMS2=1 $SMSSERVER="FLOADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63. 68." $SMS2=1 $SMSSERVER="FLOADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = "161. 63. 69." $SMS2=1 $SMSSERVER="FLOADS001"EndIf
;If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 0." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
;If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 1." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 2." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 3." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 4." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 5." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 6." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 7." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 8." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 83. 9." $SMS2=1 $SMSSERVER="NWKADS001"EndIf
If SubStr(@IPADDRESS0, 1, 12) = " 10. 4. 1." $SMS2=1 $SMSSERVER="LRNADS001"EndIf












If ( Exist ("%WINDIR%\smsno.dat") > 0 ) $SMS2=0 EndIf
If $SMS2 = 1
AT (17,25) "SMS Server is "
Color y+/n
"$SMSSERVER"
Else
AT (17,40) "SMS 2.0 is "
Color y+/n
"Not Enabled"
EndIf
AT (24,79)

Return



; ***********************************************
; * DISCOVER USERS FILE & PRINT SERVER NAME *
; ***********************************************
ISCOVER_FPSERVER

Color w+/n
AT (18,25) "Detecting File & Print Server"
AT (24,79)

$FPSERVER = ""

;IF INGROUP("SAOxUsers") $SITE = "SAO" $HDIR=0 $FPSERVER="SAOAPP002" ENDIF - Example
If InGroup("CITxUsers") $SITE = "CIT" $HDIR=1 $FPSERVER="CITFPS002" EndIf
If InGroup("TRYxUsers") $SITE = "TRY" $HDIR=1 $FPSERVER="TRYFPS003" EndIf
If InGroup("NWKxUsers") $SITE = "NWK" $HDIR=1 $FPSERVER="NWKFPS001" EndIf
If InGroup("FRKxTempMigr") $SITE = "FRK" $HDIR=1 $FPSERVER="FRKFPS002" EndIf
If InGroup("KTNxTempMigr") $SITE = "KTN" $HDIR=1 $FPSERVER="KTNFPS001" EndIf
If InGroup("EHQxUsers") $SITE = "CIT" $HDIR=1 $FPSERVER="CITFPS002" EndIf
If InGroup("SPAxUsers") $SITE = "SPA" $HDIR=1 $FPSERVER="SPAFPS001" EndIf
If InGroup("TPLxUsers") $Site = "TPL" $HDIR=1 $FPSERVER="TPLFPS001" EndIf
If InGroup("TAYxUsers") $Site = "TAY" $HDIR=1 $FPSERVER="TAYFPS002" EndIf
If InGroup("CKVxUsers") $Site = "CKV" $HDIR=0 $FPSERVER="CKVAPP001" EndIf
If InGroup("DETxUsers") $Site = "DET" $HDIR=1 $FPSERVER="DETFPS001" EndIf
If InGroup("CONxUsers") $Site = "CND" $HDIR=1 $FPSERVER="CONFPS001" EndIf
If InGroup("HEBxUsers") $Site = "HEB" $HDIR=1 $FPSERVER="HEBFPS001" EndIf
If InGroup("GLDxUsers") $Site = "GLD" $HDIR=1 $FPSERVER="GLDFPS001" EndIf
If InGroup("YRKxUsers") $Site = "YRK" $HDIR=1 $FPSERVER="YRKFPS002" EndIf
If InGroup("HOPxUsers") $SITE = "HOP" $HDIR=1 $FPSERVER="HOPFPS001" EndIf
If InGroup("FLOxUsers") $SITE = "FLO" $HDIR=1 $FPSERVER="FLOFPS004" EndIF
If InGroup("QRJxUsers") $SITE = "QRJ" $HDIR=1 $FPSERVER="QRJFPS001" EndIF
If InGroup("TILxUsers") $SITE = "TIL" $HDIR=1 $FPSERVER="TILFPS002" EndIF
If InGroup("FRKxUsers") $SITE = "FRK" $HDIR=1 $FPSERVER="FRKFPS002" EndIf
If InGroup("AVMxUsers") $SITE = "AVM" $HDIR=1 $FPSERVER="AVMFPS001" EndIf
If InGroup("CLExUsers") $SITE = "CLE" EndIf
If InGroup("PLAxUsers") $SITE = "PLA" $HDIR=1 $FPSERVER="PLAFPS001" ENDIF
If InGroup("LRNxUsers") $SITE = "LRN" $HDIR=1 $FPSERVER="LRNFPS001" ENDIF
If InGroup("MTGxUsers") $SITE = "MTG" $HDIR=1 $FPSERVER="MTGFPS001" ENDIF
If InGroup("FRDxUsers") $SITE = "FRD" $HDIR=1 $FPSERVER="FRDFPS001" ENDIF
If InGroup("FYPxUsers") $SITE = "FYP" $HDIR=1 $FPSERVER="FYPFPS001" ENDIF
If InGroup("FYDxUsers") $SITE = "FYD" $HDIR=1 $FPSERVER="FYDFPS001" ENDIF
If InGroup("CHKxUsers") $SITE = "CHK" $HDIR=1 $FPSERVER="CHKFP001" ENDIF
If InGroup("LOUxUsers") $SITE = "LOU" $HDIR=1 $FPSERVER="LOUFPS001" ENDIF
If InGroup("BWDxUsers") $SITE = "BWD" $HDIR=1 $FPSERVER="BWDFPS001" ENDIF
If InGroup("SSPxUsers") $SITE = "SSP" $HDIR=1 $FPSERVER="SSPFPS001" ENDIF
If InGroup("ASHxUsers") $SITE = "ASH" $HDIR=1 $FPSERVER="ASHFPS001" ENDIF
If InGroup("CARxUsers") $SITE = "CAR" $HDIR=1 $FPSERVER="CARFPS001" ENDIF
If InGroup("MANxUsers") $SITE = "MAN" $HDIR=1 $FPSERVER="MANFPS002" ENDIF
If InGroup("BRAxUsers") $SITE = "BRA" ENDIF
If InGroup("MONxUsers") $SITE = "MON" ENDIF
If InGroup("EDMxUsers") $SITE = "EDM" ENDIF
If InGroup("DEXxUsers") $SITE = "DEX" $HDIR=1 $FPSERVER="DEXFPS002" ENDIF
If InGroup("PULxUsers") $SITE = "PUL" $HDIR=1 $FPSERVER="PULFP001" ENDIF
If InGroup("TMLxUsers") $SITE = "TML" $HDIR=1 $FPSERVER="TMLFPS001" ENDIF
If InGroup("FLNxUsers") $SITE = "FLN" $HDIR=1 $FPSERVER="FLNFPS001" ENDIF
If InGroup("BELxUsers") $SITE = "BEL" $HDIR=1 $FPSERVER="BELFPS001" ENDIF
If InGroup("CHAxUsers") $SITE = "CHA" $HDIR=1 $FPSERVER="CHAFPS001" ENDIF
If InGroup("PUExUsers") $SITE = "PUE" $HDIR=1 $FPSERVER="PUEFPS001" ENDIF
If InGroup("MULxUsers") $SITE = "MUL" $HDIR=1 $FPSERVER="MULFPS001" ENDIF
If InGroup("QRTxUsers") $SITE = "QRT" $HDIR=1 $FPSERVER="QRTFPS001" ENDIF
If InGroup("SLPxUsers") $SITE = "SLP" $HDIR=1 $FPSERVER="SLPFPS001" ENDIF
If InGroup("CTCxUsers") $SITE = "CTC" $HDIR=1 $FPSERVER="CTCFPS002" ENDIF
If InGroup("MILxUsers") $SITE = "MIL" $HDIR=1 $FPSERVER="MILFPS001" ENDIF
If InGroup("MSTxUsers") $SITE = "MST" $HDIR=1 $FPSERVER="MSTFPS001" ENDIF
If InGroup("AFDxUsers") $SITE = "AFD" $HDIR=1 $FPSERVER="AFDFPS002" ENDIF
If InGroup("TORxUsers") $SITE = "TOR" $HDIR=1 $FPSERVER="TORFP001" ENDIF

AT (18,25) "File & Print Server is "
Color y+/n
If $FPSERVER = ""
"UNDETECTED"
Else
"$FPSERVER"
EndIf
AT (24,79)

Return


; ***********************************************
; * Patch SQL SA Password. *
; ***********************************************
:FixSA

;If InStr(@WKSTA, "CITWTS")
; OR InStr(@WKSTA, "CITTS")
; OR InStr(@WKSTA, "TRYWTS")
; OR InStr(@WKSTA, "FYPTS")
; RETURN
;EndIf

; IF $SITE = ""
; Return
; EndIf


;SHELL "@LSERVER\NETLOGON\SAFix.bat"

;Return



; ************************************************** **
; * Apply Patches to workstations with this section *
; ************************************************** **
:PATCH

; bypass the patch if the script detects that its running on a citrix or webfarm box.

If InStr(@WKSTA, "TS") <> 4 AND InStr(@WKSTA, "IS") <> 4 AND InStr(@WKSTA, "WF") <> 4 AND InStr(@WKSTA, "MM") <> 4
RETURN
EndIf


SHELL "@LSERVER\NETLOGON\wmfpatch.cmd"


Return


; ***********************************************
; * MAP STANDARD DRIVES TO FILE & PRINT SHARES *
; ***********************************************
:MAP_DRIVES

If $HDIR=1
$HOMEDIR=@UserID + "$"
Else
$HOMEDIR=USERS
EndIf

Color w+/n
If $FPSERVER <> ""
AT (19,25) "Mapping Standard Network Drives"
AT (24,79)
Use R: /Del
Use R: "\\$FPSERVER\Apps"
Use S: /Del
Use S: "\\$FPSERVER\Share"
Use T: /Del
Use T: "\\$FPSERVER\Transfer"
Use U: /Del
Use U: "\\$FPSERVER\$HOMEDIR"

Else
AT (19,25) "Standard Network Drives Not Mapped"
AT (25,79)
EndIf

Return

; ************************************************** ******
; * MAP STANDARD HYPERION DRIVES TO HYPERION DAT SERVER *
; ************************************************** ******
:MAP_HYPERION_DRIVES

IF INGROUP(CITxHYPUSERS)
COLOR w+/n
? "MAPPING STANDARD HYPERION DRIVES STARTED........"
USE K: /DEL
USE K: "\\ADCMS020\APPS"
USE L: /DEL
uSE L: "\\ADCMS020\DATA"
COLOR g+/n
"(DRVIES MAPPED)"

EndIf

Return

; **********************************************
; * INSTALL/VERIFY SMS INSTALLATION *
; **********************************************
:INSTALL_SMS

If $SMS2 = 0 Goto SMSOFF
EndIf
$SMSCMD = @LSERVER + "\NETLOGON\smsls.bat"
AT (21,25)
Color y+/n
$SMSstate = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\S MS\Client\Client Components\Windows Management\Installation Properties","Base Component")
If $SMSstate = "TRUE"
AT (21,25) "$ReturnCode"
AT (21,25)
"Installed... "
Else
AT (21,25)
Color w+/n
"Installing SMS Client..."
Shell $SMSCMD
Color y+/n

EndIf

:SMSOFF
If $SMS2 = 0
AT (21,25)
"Not Enabled "
EndIf

Return



; ***********************************************
; * CALL SITE SPECIFIC CUSTOMIZED LOGON SCRIPTS *
; ***********************************************
:CALL_SITE_LS

$SITELS = $SITE + "LS2.KIX"

If $SITE <> ""
Call "@SCRIPTDIR\sites\$SITE\$SITELS"
EndIf

Return


These reside on our AD server
__________________

__________________
Osiris is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 05:58 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.