Precursor.kix
From espinola.net
This is a subscript of my Kixtart logon script environment.
On This Page |
precursor.kix
Header
;2345678901234567890123456789012345678901234567890123456789012345678901234567890 ; ;------------------------------------------------------------------------------; ; File Name : precursor.kix ; Last Edit : XX/XX/XXXX XX:XX AM/PM ; Edited by : username ; Description : Precursory login script for gathering system info and variables definitions ;------------------------------------------------------------------------------; ;
Predetermined Variables
This segment allows certain parts of other subscripts to be easily modified to help facilitate various forms of server or resource moves. The default information provided in this segment illustrates the use between two sites: The primary location in Boston Massachusetts, USA (LAN-1), and a secondary site in Springfield Massachusetts, USA (LAN-2) that is connected via a WAN link. Using what is provided as a basis, the variables can be easily modified or expanded throughout all of the subscripts...
Ideally, only the "$NetServerX" variables should be supplied - as they represent individual servers. Lower, you will find that those values are used to to define other variables with generic names that match the function of the service they provide. This is done so that when editing other subscripts, it will be easier to follow the logic of the variable instead of trying to remember a server by its unique name. This can go a long way with making the script to be easier to understand by someone unfamiliar with the network or servers.
;------------------------------------------------------------------------------; ; Predetermined Variables ;------------------------------------------------------------------------------; ; These are all that variables use in all sub-scripts, for centralized change management purposes... ; $FriendName="ME2" ; Friendly (short) organization name $OffOrgName="Micheal Espinola Jr, Inc." ; Official (full) organization name $LoclDomain="espinola.lan" ; Domain name (internal) $SubnetAdrA="192.168.1" ; LAN-1 subnet address (local) $SubnetAdrB="192.168.4" ; LAN-2 subnet address (remote) $NetServerA="" ; Boston SQL server 1 $NetServerB="" ; Boston domain controller / file server (old) $NetServerC="" ; Boston domain controller (PDC) $NetServerD="" ; Boston application server $NetServerE="" ; Boston domain controller $NetServerF="" ; Boston network-attached storage 1 $NetServerG="" ; Boston network-attached storage 2 $NetServerH="" ; Boston Exchange server $NetServerI="" ; Boston SQL server 2 $NetServerJ="" ; Boston file server (new) $NetServerK="" ; Springfield departmental local share $NetServerP="" ; Boston HP print server appliance $HomeServr1="" ; Home share server (old) $HomeServr2="" ; Home share server (new) $HomeDrive1="H:" ; Home Drive for Users (old) $HomeDrive2="Z:" ; Home Drive for Users (new) $ShareDriv1="" ; Share Drive for ? (not implemented yet) $ShareDriv2="" ; Share Drive for ? (not implemented yet) $FileServr1="$NetServerB" ; File Server for LAN-1 (old) $FileServr2="$NetServerG" ; File Server for ? (not implemented yet) $FileServr3="$NetServerF" ; File Server for ? (not implemented yet) $FileServr4="$NetServerJ" ; File Server for LAN-1 (new) $APPServer1="$NetServerA" ; App Server for <Special Department> (LAN-1) $APPServer2="$NetServerD" ; App Server for LAN-1 (old) $APPServer3="$NetServerI" ; App Server for LAN-1 (new) $APPServer4="$NetServerK" ; App Server for <Special Department> (LAN-2) $PrntServr1="$NetServerP" ; Print Server for LAN-1 (HP PSA) $PrntServr2="$NetServerJ" ; Print Server for LAN-1 (Windows server, not implemented yet) $PrntServr0="" ; Print Server (Old Network Print Server, If moving print shares) $MailServr1="$NetServerH" ; Mail Server $MailServr2="" ; Mail Server $InstServr1="$NetServerJ" ; Installation Server $NAVCServer="$NetServerJ" ; NAV/SAV CE Server $WSUSServer="$NetServerJ" ; WSUS Server $W2KPInsSrc="\\$InstServr1\installs\Microsoft\W2KP\I386" ; Windows 2000 Professional Installation Source $W2KSInsSrc="\\$InstServr1\installs\Microsoft\W2KS\I386" ; Windows 2000 Server Installation Source $TempMarker="ME2" ; Temporary file or folder marker for tagged processing
OS Determination
This segment allows certain parts of other subscripts to take action based on the type of operating system of the client running the script...
;------------------------------------------------------------------------------; ; Determine Specific OS Environment ;------------------------------------------------------------------------------; ; This is used to gather generic system info, for targeted scripting purposes... ; $OSTYPE ="Unknown" $OSREGTYPE="Unknown" If (@PRODUCTTYPE="Windows Vista Domain Controller") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows Vista Server") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows Vista Starter Edition") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows Vista Media Center Edition") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows Vista Professional Tablet PC") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows Vista Professional") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows Vista Home Edition") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows Server 2003 R2 Domain Controller") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows Server 2003 R2") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows Server 2003 Domain Controller") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows Server 2003") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows Starter Edition") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows XP Starter Edition") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows XP Media Center Edition") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows XP Professional Tablet PC") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows XP Professional") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows XP Home Edition") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows 2000 Domain Controller") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows 2000 Server") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows 2000 Professional") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows NT Domain Controller") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows NT Server") $OSTYPE="Server" EndIf If (@PRODUCTTYPE="Windows NT Workstation") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows Me") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows 98") $OSTYPE="Workstation" EndIf If (@PRODUCTTYPE="Windows 95") $OSTYPE="Workstation" EndIf
IP Address Determination
This segment allows certain parts of other subscripts to take action based on the subnet of the client running the script...
;------------------------------------------------------------------------------; ; Determine NIC Information ;------------------------------------------------------------------------------; ; This will allow us to get info on each octet, for targeted scripting purposes... ; $Oc1=LTRIM(split(@ipaddress0,'.')[0]) $Oc2=LTRIM(split(@ipaddress0,'.')[1]) $Oc3=LTRIM(split(@ipaddress0,'.')[2]) $Oc4=LTRIM(split(@ipaddress0,'.')[3]) $IPAdress="$Oc1.$Oc2.$Oc3.$Oc4"