KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Network Login Script

 
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive
View previous topic :: View next topic  
Author Message
agconmet
KiXforms Follower
KiXforms Follower


Joined: 12 May 2003
Posts: 15

PostPosted: Wed May 21, 2003 10:50 pm    Post subject: Network Login Script Reply with quote

Here is the login script I wrote for our company, which has multiple locations and servers. I remove some of the extra code (like drive mappings, usernames, etc...).

It has been updated many times, so I think it would be good starter code for someone.

Hopefully, someone will find this useful.

Code:
BREAK ON
GO C:      CD "C:\"
$CV="CURRENTVERSION"
$HKCU="HKEY_CURRENT_USER"
$HKLM="HKEY_LOCAL_MACHINE"
$LSVER="2.31"
$MS="MICROSOFT"
$SMWCV="SOFTWARE\Microsoft\Windows\CurrentVersion"

? "Checking Login Script Version..."
$CHECKVER=DIR("C:\NETWORK\LS_VER2.31")
   IF @ERROR<>0
      ? "Copying Login Script Down To Computer..."
      MD "C:\NETWORK"
      DEL "C:\NETWORK\*.*"
      
      COPY "@LSERVER\NETLOGON\CONMET*.*" C:\NETWORK
      COPY "@LSERVER\NETLOGON\HOSTS.*" C:\NETWORK
      COPY "@LSERVER\NETLOGON\KIX32.EXE" C:\NETWORK
      COPY "@LSERVER\NETLOGON\KIXFORMS.DLL" C:\NETWORK
      COPY "@LSERVER\NETLOGON\LOGINSCRIPT.KIX" C:\NETWORK
      COPY "@LSERVER\NETLOGON\LS_INSTALLER.BAT" C:\NETWORK
      COPY "@LSERVER\NETLOGON\LS_VER2.31" C:\NETWORK
      COPY "@LSERVER\NETLOGON\NETLOGON.BAT" C:\NETWORK
      SHELL "%COMSPEC% /C REGSVR32 /S C:\NETWORK\KIXFORMS.DLL"
      COPY "@LSERVER\NETLOGON\ConMet*.lnk" C:\NETWORK
      SHELL "%COMSPEC% /C C:\NETWORK\LS_INSTALLER.BAT"
   ENDIF

IF INSTR(@PRODUCTTYPE,"Server") OR INSTR(@PRODUCTTYPE,"Domain Controller")
   $FUNCTOEXECUTE=SPLIT("COMPUTERINFO,SERVERDRIVES,EXITSCRIPT",",")
ELSE
   $FUNCTOEXECUTE=SPLIT("COMPUTERINFO,USERINFO,HARDWAREINFO,SOFTWAREINFO,NETWORKDRIVES,EXITSCRIPT",",")
ENDIF

$FORMROOT=CREATOBJECT("KIXTART.FORM")
IF @ERROR
   $NUL=SETCONSOLE("SHOW")
   "KIXFORMS.DLL NOT INSTALLED/REGISTERED" ?
   IF @INWIN="1"
      SHELL "%COMSPEC% /C REGSVR32 /S C:\NETWORK\KIXFORMS.DLL"
   ELSE
      SHELL "%COMSPEC% /C %WINDIR%\SYSTEM\REGSVR32 /S C:\NETWORK\KIXFORMS.DLL"
   ENDIF
   $FORMROOT=CREATOBJECT("KIXTART.FORM")
   IF @ERROR
      "Unable To Register KIXFORMS.DLL, Please Contact The IT Network Department." ??
      "Press ENTER To Continue..." ?
      GET $S
      EXIT(1)
   ENDIF   
ENDIF

$NUL=SETCONSOLE("HIDE")
;$NUL=SETCONSOLE("SHOW")
CLS
$FORMMAIN=CREATEOBJECT("KIXTART.FORM")
$FORMMAIN.SIZE=600,490
$FORMMAIN.BACKCOLOR=255,255,255
$FORMMAIN.SYSMENU=0
$FORMMAIN.TEXT="COMPANY1 Network Login Script $LSVER"
$FORMMAIN.CENTER

$FRAMEWELCOME=$FORMMAIN.FRAME
$FRAMEWELCOME.SIZE=580,50
$FRAMEWELCOME.CENTER
$FRAMEWELCOME.TOP=0
$FRAMEWELCOME.TEXT="Welcome:"

$LABELWELCOMELINE1=$FRAMEWELCOME.LABEL("Welcome to the COMPANY1 Network! This program will validate your network access and provide the necessary resources.",5,20,0,20)
$LABELWELCOMELINE1.ALIGNMENT=1

$FRAMECOMPUTERINFO=$FORMMAIN.FRAME
$FRAMECOMPUTERINFO.SIZE=285,110
$FRAMECOMPUTERINFO.CENTER
$FRAMECOMPUTERINFO.TOP=$FRAMEWELCOME.BOTTOM+5
$FRAMECOMPUTERINFO.LEFT=7
$FRAMECOMPUTERINFO.TEXT="Computer Information:"

$FRAMEUSERINFO=$FORMMAIN.FRAME
$FRAMEUSERINFO.SIZE=285,110
$FRAMEUSERINFO.CENTER
$FRAMEUSERINFO.TOP=$FRAMEWELCOME.BOTTOM+5
$FRAMEUSERINFO.LEFT=302
$FRAMEUSERINFO.TEXT="User Information:"

$FRAMEHARDWAREINFO=$FORMMAIN.FRAME
$FRAMEHARDWAREINFO.SIZE=285,210
$FRAMEHARDWAREINFO.CENTER
$FRAMEHARDWAREINFO.TOP=$FRAMECOMPUTERINFO.BOTTOM+5
$FRAMEHARDWAREINFO.LEFT=7
$FRAMEHARDWAREINFO.TEXT="Hardware Information:"

$FRAMESOFTWAREINFO=$FORMMAIN.FRAME
$FRAMESOFTWAREINFO.SIZE=285,210
$FRAMESOFTWAREINFO.CENTER
$FRAMESOFTWAREINFO.TOP=$FRAMEUSERINFO.BOTTOM+5
$FRAMESOFTWAREINFO.LEFT=302
$FRAMESOFTWAREINFO.TEXT="Software Information:"

$IMAGELOGO=$FORMMAIN.IMAGE("@SCRIPTDIR\COMPANY1.BMP",47,$FRAMEHARDWAREINFO.BOTTOM+5,0,0)
$IMAGELOGO.BORDERSTYLE=0

$FRAMESTATUS=$FORMMAIN.FRAME
$FRAMESTATUS.SIZE=285,70
$FRAMESTATUS.CENTER
$FRAMESTATUS.TOP=$FRAMESOFTWAREINFO.BOTTOM+5
$FRAMESTATUS.LEFT=302
$FRAMESTATUS.TEXT="Logon Progress:"

$LABELSTATUS=$FRAMESTATUS.LABEL("Processing logonscript...",10,20,260,20)

$PROGRESSSTATUS=$FRAMESTATUS.PROGRESSBAR
$PROGRESSSTATUS.SIZE=260,20
$PROGRESSSTATUS.CENTER
$PROGRESSSTATUS.TOP=$LABELSTATUS.BOTTOM

$FORMLOGO.SHOW
$FORMMAIN.SHOW
$PROGRESSSTATUS.MAX=UBOUND($FUNCTOEXECUTE)+3

FOR EACH $SFUNCTION IN $FUNCTOEXECUTE
   $PROGRESSSTATUS.VALUE=$PROGRESSSTATUS.VALUE+1
   $NUL=EXECUTE($SFUNCTION)
NEXT

FUNCTION COMPUTERINFO()
   $LABELSTATUS.TEXT="Checking Computer Information..."

   $OSVERSION=@PRODUCTTYPE

     IF VAL(@DOS)<5 $OSVERSION="UNSUPPORTED"
      EXIT
   ENDIF

   $SPVERSION=@CSD

   $LABELCOMPUTERINFOOSVERSION=$FRAMECOMPUTERINFO.LABEL("Operating System: $OSVERSION",5,20,0,20)
   $LABELCOMPUTERINFOOSVERSION.ALIGNMENT=1
   $LABELCOMPUTERINFOOSSERVICEPACK=$FRAMECOMPUTERINFO.LABEL("Service Pack: $SPVERSION",5,40,0,20)
   $LABELCOMPUTERINFOOSSERVICEPACK.ALIGNMENT=1

   $NIC=0

   ; DETERMINE WHERE COMPUTER IS LOCATION ON NETWORK AND ASSIGN SERVER
   :NICLOOP
      $IPGW=ENUMIPINFO($NIC,3)

      SELECT
         CASE $IPGW="192.9.200.1"   $SITEID="01"   $LOCATION="LOCATION1"      $SERVER="SERVER1"
         CASE $IPGW="192.9.201.1"   $SITEID="01"   $LOCATION="LOCATION1"      $SERVER="SERVER1"
         CASE $IPGW="192.9.202.1"   $SITEID="01"   $LOCATION="LOCATION1"      $SERVER="SERVER1"
         CASE $IPGW="192.9.210.1"   $SITEID="02"   $LOCATION="LOCATION3"      $SERVER="SERVER3"
         CASE $IPGW="192.9.220.1"   $SITEID="03"   $LOCATION="LOCATION4"      $SERVER="SERVER1"
         CASE $IPGW="192.9.230.1"   $SITEID="04"   $LOCATION="LOCATION5"      $SERVER="SERVER1"
         CASE $IPGW="192.9.232.1"   $SITEID="05"   $LOCATION="LOCATION6"      $SERVER="SERVER1"
         CASE $IPGW="192.9.235.1"   $SITEID="06"   $LOCATION="LOCATION7"      $SERVER="SERVER1"
         CASE $IPGW="192.9.236.1"   $SITEID="07"   $LOCATION="LOCATION8"      $SERVER="SERVER1"
         CASE $IPGW="192.9.240.1"   $SITEID="08"   $LOCATION="LOCATION2"      $SERVER="SERVER2"
         CASE $IPGW="192.9.250.1"   $SITEID="09"   $LOCATION="LOCATION9"      $SERVER="SERVER1"
         CASE $IPGW="192.168.0.1"   $SITEID="99"   $LOCATION="VPN - Protected"   $SERVER="SERVER1"
         CASE $IPGW="192.168.1.1"   $SITEID="99"   $LOCATION="VPN - Protected"   $SERVER="SERVER1"
         CASE 1            $SITEID="00"   $LOCATION="VPN - Unprotected"   $SERVER="SERVER1"
      ENDSELECT

      IF $SITEID = "00" AND VAL($NIC) < 10
         $NIC=VAL($NIC)+1
         GOTO NICLOOP
      ENDIF

   $IPADDRESS=ENUMIPINFO($NIC,0)

   $LABELCOMPUTERINFODHCPSTATUS=$FRAMECOMPUTERINFO.LABEL("IP Address: $IPADDRESS",5,60,0,20)
   $LABELCOMPUTERINFODHCPSTATUS.ALIGNMENT=1
   $LABELCOMPUTERINFOLOCATION=$FRAMECOMPUTERINFO.LABEL("Location: $LOCATION",5,80,0,20)
   $LABELCOMPUTERINFOLOCATION.ALIGNMENT=1
ENDFUNCTION

FUNCTION USERINFO()
   $LABELSTATUS.TEXT="Checking User Information..."

   $LABELUSERINFOUSERNAME=$FRAMEUSERINFO.LABEL("Computer Username: @USERID",5,20,0,20)
   $LABELUSERINFOUSERNAME.ALIGNMENT=1
   
   $USERSTATUS=%USERDOMAIN%

   $DOMAINUSER="DOMAIN\"+%USERNAME%

   ;IF USER IS LOGGED INTO DOMAIN, FIND OUT WHERE THEY BELONG ON THE NETWORK AND OVERRIDE THE SERVER IF NECESSARY
   
   $COMPANY1AD=GETOBJECT("LDAP://DOMAINSERVER/CN=%USERNAME%,CN=Users,DC=DOMAIN,DC=dom")
   $USEROFFICE=$COMPANY1AD.PHYSICALDELIVERYOFFICENAME
   
   $LABELUSERINFONETWORKUSER=$FRAMEUSERINFO.LABEL("Network Username: $DOMAINUSER",5,40,0,20)
   $LABELUSERINFONETWORKUSER.ALIGNMENT=1
   
   IF $USEROFFICE
      SELECT
         CASE $USEROFFICE="LOCATION4"   $SITEID="03"   $SERVER=""
         CASE $USEROFFICE="LOCATION9"   $SITEID="09"   $SERVER=""
         CASE $USEROFFICE="LOCATION2"   $SITEID="08"   $SERVER="SERVER2"
         CASE $USEROFFICE="LOCATION8"   $SITEID="07"   $SERVER=""
         CASE $USEROFFICE="LOCATION5"   $SITEID="04"   $SERVER=""
         CASE $USEROFFICE="LOCATION3"   $SITEID="02"   $SERVER="SERVER3"
         CASE $USEROFFICE="LOCATION1"   $SITEID="01"   $SERVER="SERVER1"
         CASE $USEROFFICE="LOCATION6"   $SITEID="05"   $SERVER=""
         CASE $USEROFFICE="LOCATION7"   $SITEID="06"   $SERVER="SERVER1"
      ENDSELECT
   ENDIF

   ;IF USER IS USING VPN, THEN THEY ARE NOT ON DOMAIN, SO ASSIST THEM IN SELECTING CORRECT SERVER (SERVER1 IS DEFAULT)       

   IF $SITEID="99" OR $SITEID="00"
      SELECT
         CASE $DOMAINUSER="DOMAIN\USER1"      $SERVER="SERVER2"   $USEROFFICE="LOCATION2"
         CASE $DOMAINUSER="DOMAIN\USER2"      $SERVER="SERVER2"   $USEROFFICE="LOCATION2"
         CASE $DOMAINUSER="DOMAIN\USER3"      $SERVER="SERVER3"   $USEROFFICE="LOCATION3"
         CASE 1               $SERVER="SERVER1"   $USEROFFICE="LOCATION1"
      ENDSELECT
   ENDIF

   $LABELUSERINFOSERVER=$FRAMEUSERINFO.LABEL("Logon Server: $SERVER",5,60,0,20)
   $LABELUSERINFOSERVER.ALIGNMENT=1
   
   $LABELUSERINFOOFFICE=$FRAMEUSERINFO.LABEL("Logon Location: $USEROFFICE",5,80,0,20)
   $LABELUSERINFOOFFICE.ALIGNMENT=1
ENDFUNCTION

FUNCTION HARDWAREINFO()
   $LABELSTATUS.TEXT="Getting Hardware Info..."
   
   $COMPUTERNAME=@HOSTNAME   
   $MAKE=WMIQUERY("MANUFACTURER","WIN32_COMPUTERSYSTEM")
   $MODEL=WMIQUERY("MODEL","WIN32_COMPUTERSYSTEM")
   $SERIALNO=WMIQUERY("SERIALNUMBER","WIN32_BIOS")

   IF $SERIALNO < " "    
      $SERIALNO=WMIQUERY("SMBIOSASSETTAG","WIN32_SYSTEMENCLOSURE")
   ENDIF
   
   $CPU=@CPU
   $MHZ=@MHZ+3
   $RAM=MEMORYSIZE()+1
   
   $CFREESPACETOTAL=(GETDISKSPACE("C:\"))/1048
   $CFREESPACETHOUSANDS=($CFREESPACETOTAL/1000)
   $CFREESPACEHUNDREDS=($CFREESPACETOTAL-($CFREESPACETHOUSANDS*1000))
   $CFREESPACE=("$CFREESPACETHOUSANDS.$CFREESPACEHUNDREDS")

   $DFREESPACETOTAL=(GETDISKSPACE("D:\"))/1048
   $DFREESPACETHOUSANDS=($DFREESPACETOTAL/1000)
   $DFREESPACEHUNDREDS=($DFREESPACETOTAL-($DFREESPACETHOUSANDS*1000))
   $DFREESPACE=("$DFREESPACETHOUSANDS.$DFREESPACEHUNDREDS")
   $DFREESPACERAW=GETDISKSPACE("D:\")
   IF $DFREESPACERAW=""
      $DFREESPACE="CD/DVD DRIVE"
   ELSE
      $DFREESPACE=$DFREESPACE+" GB"
   ENDIF
   
   $LABELHARDWAREINFOCOMPUTERNAME=$FRAMEHARDWAREINFO.LABEL("Computer Name: $COMPUTERNAME",5,20,0,20)
   $LABELHARDWAREINFOCOMPUTERNAME.ALIGNMENT=1
   $LABELHARDWAREINFOMANUFACTURER=$FRAMEHARDWAREINFO.LABEL("Computer Manufacturer: $MAKE",5,40,0,20)
   $LABELHARDWAREINFOMANUFACTURER.ALIGNMENT=1
   $LABELHARDWAREINFOMODEL=$FRAMEHARDWAREINFO.LABEL("Computer Model: $MODEL",5,60,0,20)
   $LABELHARDWAREINFOMODEL.ALIGNMENT=1
   $LABELHARDWAREINFOSERIALNUMBER=$FRAMEHARDWAREINFO.LABEL("Computer Serial Number: $SERIALNO",5,80,0,20)
   $LABELHARDWAREINFOSERIALNUMBER.ALIGNMENT=1
   $LABELHARDWAREINFOPROCESSOR=$FRAMEHARDWAREINFO.LABEL("Computer Processor: $CPU",5,100,0,20)
   $LABELHARDWAREINFOPROCESSOR.ALIGNMENT=1
   $LABELHARDWAREINFOPROCESSORSPEED=$FRAMEHARDWAREINFO.LABEL("Computer Processor Speed: $MHZ MHz",5,120,0,20)
   $LABELHARDWAREINFOPROCESSORSPEED.ALIGNMENT=1
   $LABELHARDWAREINFOMEMORY=$FRAMEHARDWAREINFO.LABEL("Computer Memory: $RAM MB",5,140,0,20)
   $LABELHARDWAREINFOMEMORY.ALIGNMENT=1
   $LABELHARDWARECFREESPACE=$FRAMEHARDWAREINFO.LABEL("C: Drive Free Space: $CFREESPACE GB",5,160,0,20)
   $LABELHARDWARECFREESPACE.ALIGNMENT=1
   $LABELHARDWAREDFREESPACE=$FRAMEHARDWAREINFO.LABEL("D: Drive Free Space: $DFREESPACE",5,180,0,20)
   $LABELHARDWAREDFREESPACE.ALIGNMENT=1

ENDFUNCTION   

FUNCTION SOFTWAREINFO()
   $LABELSTATUS.TEXT="Getting Software Info..."

   $RECONNECT=WRITEVALUE("$HKCU\SOFTWARE\$MS\Windows NT\$CV\Network\Persistent Connections","SaveConnections","NO",REG_SZ)
 
   $IE=READVALUE("$HKLM\SOFTWARE\$MS\INTERNET EXPLORER", "VERSION")
      SELECT
         CASE $IE=""         $IEVER="NOT INSTALLED"
         CASE $IE<"6.0.2800.0000"   $IEVER="UPGRADE"
         CASE $IE="6.0.2800.0000"   $IEVER="6.0"
         CASE $IE="6.0.2800.1106"   $IEVER="6.0 SP1"
         CASE $IE>"6.0.2800.1106"   $IEVER="6.0 SP1"
         CASE 1            $IEVER="UNKNOWN"
      ENDSELECT
   
   $OFFICEDIR=READVALUE("$HKLM\$SMWCV\APP PATHS\EXCEL.EXE","PATH")
      
   $ACCESS=GETFILEVERSION("$OFFICEDIR\MSACCESS.EXE")
      SELECT
         CASE $ACCESS=""         $ACCESSVER="NOT INSTALLED"
         CASE $ACCESS<"10.0.2627"   $ACCESSVER="UPGRADE"
         CASE $ACCESS="10.0.2627"   $ACCESSVER="2002"
         CASE $ACCESS="10.0.3409"   $ACCESSVER="2002 SP1"
         CASE $ACCESS="10.0.4302"   $ACCESSVER="2002 SP2"
         CASE $ACCESS>"10.0.4302"   $ACCESSVER="2002 SP2"
         CASE 1            $ACCESSVER="UNKNOWN"
      ENDSELECT

   $EXCEL=GETFILEVERSION("$OFFICEDIR\EXCEL.EXE")
      SELECT
         CASE $EXCEL=""         $EXCELVER="NOT INSTALLED"
         CASE $EXCEL<"10.0.2614"      $EXCELVER="UPGRADE"
         CASE $EXCEL="10.0.2614"      $EXCELVER="2002"
         CASE $EXCEL="10.0.3506"      $EXCELVER="2002 SP1"
         CASE $EXCEL="10.0.4302"      $EXCELVER="2002 SP2"
         CASE $EXCEL>"10.0.4302"      $EXCELVER="2002 SP2"
         CASE 1            $EXCELVER="UNKNOWN"
      ENDSELECT

   $OUTLOOK=GETFILEVERSION("$OFFICEDIR\OUTLOOK.EXE")
      SELECT
         CASE $OUTLOOK=""      $OUTLOOKVER="NOT INSTALLED"
         CASE $OUTLOOK<"10.0.2627"   $OUTLOOKVER="UPGRADE"
         CASE $OUTLOOK="10.0.2627"   $OUTLOOKVER="2002"
         CASE $OUTLOOK="10.0.3416"   $OUTLOOKVER="2002 SP1"
         CASE $OUTLOOK="10.0.4024"   $OUTLOOKVER="2002 SP2"
         CASE $OUTLOOK>"10.0.4024"   $OUTLOOKVER="2002 SP2"
         CASE 1            $OUTLOOKVER="UNKNOWN"
      ENDSELECT
      
   $POWERPOINT=GETFILEVERSION("$OFFICEDIR\POWERPNT.EXE")
      SELECT
         CASE $POWERPOINT=""      $POWERPOINTVER="NOT INSTALLED"
         CASE $POWERPOINT<"10.0.2623"   $POWERPOINTVER="UPGRADE"
         CASE $POWERPOINT="10.0.2623"   $POWERPOINTVER="2002"
         CASE $POWERPOINT="10.0.3506"   $POWERPOINTVER="2002 SP1"
         CASE $POWERPOINT="10.0.4205"   $POWERPOINTVER="2002 SP2"
         CASE $POWERPOINT>"10.0.4205"   $POWERPOINTVER="2002 SP2"
         CASE 1            $POWERPOINTVER="UNKNOWN"
      ENDSELECT
      
   $PUBLISHER=GETFILEVERSION("$OFFICEDIR\MSPUB.EXE")
      SELECT
         CASE $PUBLISHER=""      $PUBLISHERVER="NOT INSTALLED"
         CASE $PUBLISHER<"10.0.2621"   $PUBLISHERVER="UPGRADE"
         CASE $PUBLISHER="10.0.2621"   $PUBLISHERVER="2002"
         CASE $PUBLISHER="10.0.3402"   $PUBLISHERVER="2002 SP1"
         CASE $PUBLISHER="10.0.4128"   $PUBLISHERVER="2002 SP2"
         CASE $PUBLISHER>"10.0.4128"   $PUBLISHERVER="2002 SP2"
         CASE 1            $PUBLISHERVER="UNKNOWN"
      ENDSELECT
   
   $WORD=GETFILEVERSION("$OFFICEDIR\WINWORD.EXE")
      SELECT
         CASE $WORD=""         $WORDVER="NOT INSTALLED"
         CASE $WORD<"10.0.2627"      $WORDVER="UPGRADE"
         CASE $WORD="10.0.2627"      $WORDVER="2002"
         CASE $WORD="10.0.3416"      $WORDVER="2002 SP1"
         CASE $WORD="10.0.4219"      $WORDVER="2002 SP2"
         CASE $WORD>"10.0.4219"      $WORDVER="2002 SP2"
         CASE 1            $WORDVER="UNKNOWN"
      ENDSELECT
   
   $VISIODIR=READVALUE("$HKLM\$SMWCV\APP PATHS\VISIO.EXE","PATH")
      
   $VISIO=GETFILEVERSION("$VISIODIR\VISLIB.DLL")
      SELECT
         CASE $VISIO=""         $VISIOVER="NOT INSTALLED"
         CASE $VISIO<"10.0.2514"      $VISIOVER="UPGRADE"
         CASE $VISIO="10.0.525"      $VISIOVER="2002"
         CASE $VISIO="10.0.2514"      $VISIOVER="2002 SR-1"
      ENDSELECT

   $OFFICEID="{90110409-6000-11D3-8CFE-0050048383C9}"                                          
   $OFFICEVER=READVALUE("$HKLM\$SMWCV\UNINSTALL\$OFFICEID","DISPLAYNAME")

   IF $IEVER="6.0 SP1"
      $IEINSTALL="NO"
   ELSE
      $IEINSTALL="YES"
   ENDIF

   IF ($ACCESSVER AND $EXCELVER AND $OUTLOOKVER AND $POWERPOINTVER AND $WORDVER="2002")
      $OFFICEVER="2002"
      $OFFICEINSTALL="YES"
   ENDIF

   IF ($ACCESSVER AND $EXCELVER AND $OUTLOOKVER AND $POWERPOINTVER AND $WORDVER="2002 SP1")
      $OFFICEVER="2002 SP1"
      $OFFICEINSTALL="YES"
   ENDIF
   
   IF ($ACCESSVER AND $EXCELVER AND $OUTLOOKVER AND $POWERPOINTVER AND $WORDVER="2002 SP2")
      $OFFICEVER="2002 SP2"
      $OFFICEINSTALL="NO"
   ENDIF
   
   $RIGHTFAXDIR=READVALUE("$HKLM\$SMWCV\APP PATHS\FAXCTRL.EXE","PATH")
   $RIGHTFAX=GETFILEVERSION("$RIGHTFAXDIR\FAXCTRL.EXE")
      SELECT
         CASE $RIGHTFAX=""      $RIGHTFAXVER="NOT INSTALLED"
         CASE $RIGHTFAX<"8, 0, 1 ,102"   $RIGHTFAXVER="UPGRADE"
         CASE $RIGHTFAX="8, 0, 1 ,102"   $RIGHTFAXVER="8.0.1"
         CASE $RIGHTFAX>"8, 0, 1 ,102"   $RIGHTFAXVER="8.0.1"
         CASE 1            $RIGHTFAXVER="UNKNOWN"
      ENDSELECT

   IF $RIGHTFAXVER="UPGRADE"
      $RIGHTFAXINSTALL="YES"
   ELSE
      $RIGHTFAXINSTALL="NO"
   ENDIF

   $SAPDIR=READVALUE("$HKLM\SOFTWARE\SAP\SAP SHARED", "SAPDESTDIR")
   $SAP=GETFILEVERSION("$SAPDIR\SAPGUI\SAPGUI.EXE")
      SELECT
         CASE $SAP=""         $SAPVER="NOT INSTALLED"
         CASE $SAP="4640.4.256.8851"   $SAPVER="UPGRADE"
         CASE $SAP="6200.1.0.8916"   $SAPVER="6.20 C1"
         CASE $SAP="6200.2.9.8917"   $SAPVER="6.20 C2"
         CASE 1            $SAPVER="UNKNOWN"
      ENDSELECT

   $CHECKSAP=DIR("C:\PROGRAM FILES\SAPPC\SAPGUI\FRONT.EXE")
      IF @ERROR=0
         $SAPVER="UPGRADE"
      ENDIF
      
   IF $SAPVER="UPGRADE"
      $SAPINSTALL="YES"
   ELSE
      $SAPINSTALL="NO"
   ENDIF

   $RXVIEWDIR=READVALUE("$HKLM\$SMWCV\APP PATHS\RXVIEW.EXE","PATH")
   $RXVIEW=GETFILEVERSION("$RXVIEWDIR\RXVIEW.EXE")
      SELECT
         CASE $RXVIEW=""         $RXVIEWVER="NOT INSTALLED"
         CASE $RXVIEW<"3, 0, 0 ,124"   $RXVIEWVER="UPGRADE"
         CASE $RXVIEW="3, 0, 0 ,124"   $RXVIEWVER="R5 Build 124"
         CASE $RXVIEW>"3, 0, 0 ,124"   $RXVIEWVER="R5 Build 124"
         CASE 1            $RXVIEWVER="UNKNOWN"
      ENDSELECT

   IF $RXVIEWVER="UPGRADE"
      $RXVIEWINSTALL="YES"
   ELSE
      $RXVIEWINSTALL="NO"
   ENDIF

   $MYCD=READVALUE("$HKLM\SOFTWARE\VERITAS\MYCD\CURRENTVERSION", "VERSION")
   $MYCDPRO=READVALUE("$HKLM\SOFTWARE\VERITAS\MYCD PRO\CURRENTVERSION", "VERSION")
   $STOMPRN=READVALUE("$HKLM\SOFTWARE\VERITAS\RECORDNOW DX\CURRENTVERSION\ALL\WIZARD", "VERSION")
   $STOMPUM=READVALUE("$HKLM\SOFTWARE\VERITAS\STORAGEGUARD\CURRENTVERSION\ALL", "BUILDVERSION")

   IF $MYCD<>""
      $MYCDVER="UPGRADE"
   ENDIF

   IF $MYCDPRO<>""
      $MYCDPROVER="UPGRADE"
   ENDIF

   SELECT
      CASE $STOMPRN=""      $STOMPRNVER="NOT INSTALLED"
      CASE $STOMPRN="4.00"      $STOMPRNVER="UPGRADE"
      CASE $STOMPRN="4.10"      $STOMPRNVER="UPGRADE"
      CASE $STOMPRN="4.50"      $STOMPRNVER="4.50"
      CASE $STOMPRN>"4.50"      $STOMPRNVER="4.50"
      CASE 1            $STOMPRNVER="UNKNOWN"
   ENDSELECT

   IF $STOMPRNVER="UPGRADE"
      $STOMPRNINSTALL="YES"
   ELSE
      $STOMPRNINSTALL="NO"
   ENDIF

   IF ($STOMPRN="4.50" AND $STOMPUM="100B77a")
      $STOMPUMREMOVE="YES"
   ELSE
      $STOMPUMREMOVE="NO"
   ENDIF

   $SAVDIR=READVALUE("$HKLM\$SMWCV\APP PATHS\VPC32.EXE", "PATH")
   $SAVVER=GETFILEVERSION("$SAVDIR\RTVSCAN.EXE")
      
   IF $SAVVER="8.00.00.9374"
      $SAVINSTALL="NO"
   ELSE
      $SAVINSTALL="YES"
   ENDIF

   $LABELSOFTWAREINFOMSRIGHTFAX=$FRAMESOFTWAREINFO.LABEL("Captaris RightFAX [RIVERGATE Only]: $RIGHTFAXVER",5,20,0,20)
   $LABELSOFTWAREINFOMSRIGHTFAX.ALIGNMENT=1
   $LABELSOFTWAREINFOMSIE=$FRAMESOFTWAREINFO.LABEL("Microsoft Internet Explorer: $IEVER",5,40,0,20)
   $LABELSOFTWAREINFOMSIE.ALIGNMENT=1
   $LABELSOFTWAREINFOMSOFFICE=$FRAMESOFTWAREINFO.LABEL("Microsoft Office: $OFFICEVER",5,60,0,20)
   $LABELSOFTWAREINFOMSOFFICE.ALIGNMENT=1
   $LABELSOFTWAREINFOMSPUBLISHER=$FRAMESOFTWAREINFO.LABEL("Microsoft Publisher: $PUBLISHERVER",5,80,0,20)
   $LABELSOFTWAREINFOMSPUBLISHER.ALIGNMENT=1
   $LABELSOFTWAREINFOMSVISIO=$FRAMESOFTWAREINFO.LABEL("Microsoft Visio: $VISIOVER",5,100,0,20)
   $LABELSOFTWAREINFOMSVISIO.ALIGNMENT=1
   $LABELSOFTWAREINFORXVIEW=$FRAMESOFTWAREINFO.LABEL("Rasterex RxView: $RXVIEWVER",5,120,0,20)
   $LABELSOFTWAREINFORXVIEW.ALIGNMENT=1
   $LABELSOFTWAREINFOSAPFRONTEND=$FRAMESOFTWAREINFO.LABEL("SAP FrontEnd: $SAPVER",5,140,0,20)
   $LABELSOFTWAREINFOSAPFRONTEND.ALIGNMENT=1
   $LABELSOFTWAREINFOSTOMPRN=$FRAMESOFTWAREINFO.LABEL("Stomp RecordNow: $STOMPRNVER",5,160,0,20)
   $LABELSOFTWAREINFOSTOMPRN.ALIGNMENT=1
   $LABELSOFTWAREINFOSYMANTECAV=$FRAMESOFTWAREINFO.LABEL("Symantec Anti-Virus: $SAVVER",5,180,0,20)
   $LABELSOFTWAREINFOSYMANTECAV.ALIGNMENT=1
ENDFUNCTION

FUNCTION NETWORKDRIVES()
   $LABELSTATUS.TEXT="Mapping Network Drives..."

   $MAPPARAMETERS=""
   $VPNMAPPING="NO"
      
   IF ($SITEID="99" OR $SITEID="00" OR %USERDOMAIN%<>"DOMAIN")
      $FORMPASS=CREATEOBJECT("KIXTART.FORM")
      $FORMPASS.SIZE=200,100
      $FORMPASS.SYSMENU=0
      $FORMPASS.TEXT="Enter Network Password"
      $FORMPASS.TOPMOST="TRUE"
      $FORMPASS.CENTER
         
      $LABELPASSINPUT=$FORMPASS.TEXTBOX("",20,10,155,20)
      $LABELPASSINPUT.PASSWORDCHAR="*"
      $LABELPASSINPUTBUTTON=$FORMPASS.COMMANDBUTTON("OK",75,40,40,20)
      $LABELPASSINPUTBUTTON.DEFAULT=TRUE   
      $LABELPASSINPUTBUTTON.ONCLICK="$$FORMPASS.HIDE"
      $LABELPASSINPUT.OnChange="$$PASS=$$LABELPASSINPUT.TEXT"
      
      $FORMPASS.SHOW
      WHILE $FORMPASS.VISIBLE $=EXECUTE($FORMPASS.DOEVENTS)
      LOOP

      $PASS=$LABELPASSINPUT.TEXT

      $VPNMAPPING="YES"
   ENDIF
   

   ; MAP SECURE DRIVES - THESE DON'T WORK FOR VPN USERS

   IF INGROUP("DOMAIN\GROUP - RW")
      $LABELSTATUS.TEXT="Mapping I: Drive..."
      USE I: /DELETE

      IF @ERROR<>0
         SHELL 'NET USE I: /D'
      ENDIF

      IF $VPNMAPPING="NO"
         SHELL 'NET USE I: "\\SERVER\SHARE"'
      ENDIF

      IF $VPNMAPPING="YES"
         SHELL 'NET USE I: "\\SERVER\SHARE" /USER:$DOMAINUSER $PASS'
      ENDIF
   ENDIF

   IF $SERVER
      $PROGRESSSTATUS.VALUE=$PROGRESSSTATUS.VALUE+1

      $LABELSTATUS.TEXT="Mapping Q: Drive..."
      USE Q: /DELETE

      IF @ERROR<>0
         SHELL 'NET USE Q: /D'
      ENDIF

      IF $VPNMAPPING="NO"
         SHELL 'NET USE Q: "\\$SERVER\HOME\@USERID"'
      ENDIF
      IF $VPNMAPPING="YES"
         SHELL 'NET USE Q: "\\$SERVER\HOME\@USERID" /USER:$DOMAINUSER $PASS'
      ENDIF
      
      $LABELSTATUS.TEXT="Mapping S: Drive..."
      USE S: /DELETE

      IF @ERROR<>0
         SHELL 'NET USE S: /D'
      ENDIF

      IF $VPNMAPPING="NO"
         SHELL 'NET USE S: "\\$SERVER\SOFTWARE"'
      ENDIF
      IF $VPNMAPPING="YES"
         SHELL 'NET USE S: "\\$SERVER\SOFTWARE" /USER:$DOMAINUSER $PASS'
      ENDIF

      $LABELSTATUS.TEXT="Mapping Z: Drive..."
      USE Z: /DELETE
      
      IF @ERROR<>0
         SHELL 'NET USE Z: /D'
      ENDIF

      IF $VPNMAPPING="NO"
         SHELL 'NET USE Z: "\\$SERVER\VPHOME"'
      ENDIF
      IF $VPNMAPPING="YES"
         SHELL 'NET USE Z: "\\$SERVER\VPHOME" /USER:$DOMAINUSER $PASS'
      ENDIF
      
      IF $VPNMAPPING="NO" AND ($LOCATION<>"LOCATION4" AND $LOCATION<>"LOCATION9" AND $LOCATION<>"LOCATION8" AND $LOCATION<>"LOCATION5" AND $LOCATION<>"LOCATION6")
         $LABELSTATUS.TEXT="Configuring Network Settings..."
         $=WRITEVALUE("$HKCU$SMWCV\Internet Settings","ProxyEnable","0",REG_DWORD)
         $=ADDKEY("$HKCU$SMWCV\Internet Settings\ZoneMap\Domains\DOMAININTERNETNAME")
         $=WRITEVALUE("$HKCU$SMWCV\Internet Settings\ZoneMap\Domains\DOMAININTERNETNAME","*","1",REG_DWORD)
         MD "%SYSTEMROOT%\%USERNAME%\Outlook"

         IF $OSVERSION="Windows 2000 Professional" AND $SPVERSION<>"Service Pack 3"
            $LABELSTATUS.TEXT="Installing Microsoft Windows 2000 SP3..."
            SHELL '%COMSPEC% /C "S:\MICROSOFT\MICROSOFT WINDOWS 2000 SERVICE PACK 3\UPDATE\UPDATE.EXE" /U /N'
            EXIT
         ENDIF

         IF $IEINSTALL="YES"
            $LABELSTATUS.TEXT="Installing Microsoft Internet Explorer 6.0 SP1..."
            SHELL '%COMSPEC% /C "S:\MICROSOFT\MICROSOFT INTERNET EXPLORER 6.0 SP1\WIN32\EN\IE6SETUP.EXE"'
            EXIT
         ENDIF

         IF ($OFFICEINSTALL="YES" AND $OFFICEVER="2002")
            $LABELSTATUS.TEXT="Installing Microsoft Office 2002 SP1..."
            SHELL '%COMSPEC% /C "S:\MICROSOFT\MICROSOFT OFFICE PROFESSIONAL 2002\OXPSP1.EXE" /Q'
            EXIT
         ENDIF

         IF ($OFFICEINSTALL="YES" AND $OFFICEVER="2002 SP1")
            $LABELSTATUS.TEXT="Installing Microsoft Office 2002 SP2..."
            SHELL '%COMSPEC% /C "S:\MICROSOFT\MICROSOFT OFFICE PROFESSIONAL 2002\OXPSP2.EXE" /Q'
            EXIT
         ENDIF
         
         IF ($RIGHTFAXINSTALL="YES" AND $USEROFFICE="Rivergate")
            $LABELSTATUS.TEXT="Installing RightFAX Client 8.0.1..."
            SHELL '%COMSPEC% /C "MSIEXEC /I S:\CAPTARIS\CAPTARIS RIGHTFAX 8.01\RFCLIENT8.01.MSI /QR"'
            EXIT
         ENDIF

         IF $SAPINSTALL="YES"
            $LABELSTATUS.TEXT="Installing SAP FrontEnd 6.20 C2..."
            SHELL '%COMSPEC% /C "S:\SAP\SAP FRONTEND 6.20 C2\SETUP\NETSETUP.EXE"'
            EXIT
         ENDIF

         IF $STOMPRNINSTALL="YES"
            $LABELSTATUS.TEXT="Installing Stomp RecordNow Update..."
            SHELL '%COMSPEC% /C "S:\STOMP\STOMP RECORDNOW MAX 4.50 UPGRADE\STPRNM450V.EXE"'
            EXIT
         ENDIF

         ;THIS PART OF STOMP RECORDNOW CAUSES SHUTDOWN PROBLEMS, SO REMOVE IT

         IF $STOMPUMREMOVE="YES"
            $LABELSTATUS.TEXT="Uninstalling Stomp RecordNow Update Manager..."
            SHELL '%COMSPEC% /C "MSIEXEC /X {09DA4F91-2A09-4232-AB8C-6BC740096DE3} /QN"'
            EXIT
         ENDIF
         
         IF $SAVINSTALL="YES"
            $LABELSTATUS.TEXT="Installing Symantec Anti-Virus Client..."
            SHELL '%COMSPEC% /C "Z:\CLT-INST\WIN32\SETUP.EXE"'
            EXIT
         ENDIF
      ENDIF
      IF ($VPNMAPPING="YES" AND $LOCATION="VPN - Protected")
         $LABELSTATUS.TEXT="Configuring Network Settings..."
         $=WRITEVALUE("$HKCU$SMWCV\Internet Settings","ProxyEnable","0",REG_DWORD)
         $=ADDKEY("$HKCU$SMWCV\Internet Settings\ZoneMap\Domains\DOMAININTERNETNAME")
         $=WRITEVALUE("$HKCU$SMWCV\Internet Settings\ZoneMap\Domains\DOMAININTERNAME","*","1",REG_DWORD)
         
         IF $SAVINSTALL="YES"
            $LABELSTATUS.TEXT="Installing Symantec Anti-Virus Client..."
            SHELL 'RD /Q /S "%SYSTEMDRIVE%\NAVTEMP"'
            SHELL 'RD /Q /S "%SYSTEMDRIVE%\SAVTEMP"'
            MD "%SYSTEMDRIVE%\SAVTEMP"
            $LABELSTATUS.TEXT="Copying GRC.DAT File To Computer..."
            SHELL 'XCOPY "Z:\CLT-INST\WIN32\GRC.DAT" "%SYSTEMDRIVE%\SAVTEMP" /S /E /F'
            $LABELSTATUS.TEXT="Copying SETUP.EXE File To Computer..."
            SHELL 'XCOPY "Z:\CLT-INST\WIN32\SETUP.EXE" "%SYSTEMDRIVE%\SAVTEMP" /S /E /F'
            SHELL '%SYSTEMDRIVE%\SAVTEMP\SETUP.EXE'
         ENDIF
      ENDIF   
      
      $PROGRESSSTATUS.VALUE=$PROGRESSSTATUS.VALUE+1

      IF ($VPNMAPPING="YES" AND $LOCATION="VPN - Unprotected")
         $LABELSTATUS.TEXT="Skipping Updates Due To Slow Connection..."
      ELSE
         $LABELSTATUS.TEXT="Updating SAP Configuration Files..."

         DEL %WINDIR%\SAPLOGON.INI
         DEL %WINDIR%\SAPMSG.INI
         DEL %WINDIR%\SAPROUTE.INI

         IF INGROUP("DOMAIN\SAPUPDATES - RW") AND $VPNMAPPING="NO"
            COPY S:\NETWORK\MIS\ADMIN\SAPLOGON.INI %WINDIR%
         ELSE
            COPY S:\NETWORK\MIS\SAPLOGON.INI %WINDIR%
         ENDIF

         COPY S:\NETWORK\MIS\SAPMSG.INI %WINDIR%
         COPY S:\NETWORK\MIS\SAPROUTE.INI %WINDIR%
      
         $LABELSTATUS.TEXT="Updating Symantec Anti-Virus Definitions..."
         $SAVDEFS=READVALUE("$HKLM\SOFTWARE\INTEL\LANDESK\VIRUSPROTECT6\CURRENTVERSION", "CurrentPatternName")

         IF $SAVDEFS<>""
            IF EXISTS ("Z:\$SAVDEFS")
               SHELL '%COMSPEC% /C COPY "Z:\$SAVDEFS" "%USERPROFILE%\Local Settings\Application Data\Symantec\Norton AntiVirus Corporate Edition\7.5" >nul'
               SHELL '%COMSPEC% /C NET STOP "Symantec AntiVirus Client" >NUL'
               SHELL '%COMSPEC% /C NET START "Symantec AntiVirus Client" >NUL'
            ENDIF
         ENDIF
      ENDIF
   ENDIF
ENDFUNCTION

FUNCTION SERVERDRIVES()
   IF $LOCATION="LOCATION2" OR $LOCATION="LOCATION3" OR $LOCATION="LOCATIOn1"
      $PROGRESSSTATUS.VALUE=$PROGRESSSTATUS.VALUE+2
      USE S: /DELETE

      IF @ERROR<>0
         SHELL 'NET USE S: /D'
      ENDIF

      SHELL 'NET USE S: "\\$SERVER\SOFTWARE"'
   ENDIF
ENDFUNCTION

FUNCTION EXITSCRIPT()
   $LABELSTATUS.TEXT="Login Script Is Complete."
   
   $FORMLOGO.HIDE
   $FORMMAIN.HIDE
ENDFUNCTION

FUNCTION WMIQUERY($WHAT,$WHERE)
   DIM $STRQUERY, $OBJENUMERATOR, $VALUE
   $STRQUERY = "SELECT $WHAT FROM $WHERE"
   $SYSTEMSET = GETOBJECT("WINMGMTS:{IMPERSONATIONLEVEL=IMPERSONATE}!//@WKSTA")
   $OBJENUMERATOR = $SYSTEMSET.EXECQUERY($STRQUERY)
   FOR EACH $OBJINSTANCE IN $OBJENUMERATOR
      IF @ERROR = 0 AND $OBJINSTANCE <> ""
         $=EXECUTE("$$VALUE = $$OBJINSTANCE.$WHAT")
         $WMIQUERY="$VALUE"+"|"+"$WMIQUERY"
      ENDIF
   NEXT

   $WMIQUERY=LEFT($WMIQUERY,LEN($WMIQUERY)-1)
   EXIT @ERROR
ENDFUNCTION


Last edited by agconmet on Sun Jun 29, 2003 3:19 am; edited 1 time in total
Back to top
View user's profile Send private message
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Thu May 22, 2003 12:16 am    Post subject: Reply with quote

Looks familiar... www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=13;t=000366 Wink

I based my loginscript sample off of the loginscript sample that was included in KiXGUI (written by Alex H.).

BTW, these lines are unnecessary...

Code:

WHILE $FORMMAIN.VISIBLE $=EXECUTE($FORMMAIN.DOEVENTS)
LOOP

...since you are not running KiXforms in "application mode." Your script actually HIDES the form before these lines are even run.
Back to top
View user's profile Send private message MSN Messenger
prkrnt
KiXforms Novice
KiXforms Novice


Joined: 15 Jan 2004
Posts: 1

PostPosted: Thu Jan 15, 2004 11:22 pm    Post subject: Reply with quote

Can you provide copies of your netlogon.bat and ls_installer.bat?
Back to top
View user's profile Send private message
agconmet
KiXforms Follower
KiXforms Follower


Joined: 12 May 2003
Posts: 15

PostPosted: Thu Jan 15, 2004 11:32 pm    Post subject: BAT Files Reply with quote

Here is the LS_INSTALL.BAT; note the PW_INSTALLER.BAT is for the Print Wizard app, you can remove this line.

Code:

SET ZZZLS=2.41
IF "%OS%"=="Windows_NT" GOTO 2000_XP
GOTO WIN9X

:2000_XP
ECHO.
ECHO INSTALLING ZZZ LOGIN SCRIPT...
ECHO.
IF EXIST %SYSTEMDRIVE%\NETWORK\LS_VER%ZZZLS% GOTO CLEANUPVER
GOTO FINISHVER

:FINISHVER
IF EXIST %SYSTEMDRIVE%\NETWORK\LS_VER%ZZZLS% GOTO CLEANUPICON
GOTO FINISHICON

:FINISHICON
IF EXIST %SYSTEMDRIVE%\NETWORK\HOSTS. DEL /F /Q %SYSTEMDRIVE%\NETWORK\HOSTS.
COPY %SYSTEMDRIVE%\NETWORK\HOSTS.TXT %WINDIR%\SYSTEM32\DRIVERS\ETC\HOSTS.
IF EXIST "C:\DOCUMENTS AND SETTINGS" GOTO 2000_ICONS
ECHO CREATING WINDOWS NT ICONS...
ECHO.
C:
CD\
CD %WINDIR%
CD "PROFILES"
CD "ALL USERS"
CD "DESKTOP"
IF EXIST "ZZZ NETWORK LOGIN*.LNK" DEL /F /Q "ZZZ NETWORK LOGIN*.LNK"
XCOPY %SYSTEMDRIVE%\NETWORK\*.LNK *.* /S /E /F
GOTO END

:CLEANUPVER
IF EXIST "%SYSTEMDRIVE%\NETWORK\LSVER.TXT" DEL /F /Q "%SYSTEMDRIVE%\NETWORK\LSVER.TXT"
COPY "%SYSTEMDRIVE%\NETWORK\LS_VER%ZZZLS%" "%SYSTEMDRIVE%\NETWORK\LSVER.TXT"
DEL /F /Q "%SYSTEMDRIVE%\NETWORK\LS_VER*.*"
COPY "%SYSTEMDRIVE%\NETWORK\LSVER.TXT" "%SYSTEMDRIVE%\NETWORK\LS_VER%ZZZLS%"
DEL /F /Q "%SYSTEMDRIVE%\NETWORK\LSVER.TXT"
GOTO FINISHVER

:CLEANUPICON
IF EXIST "%SYSTEMDRIVE%\NETWORK\ICONLS.TXT" DEL /F /Q "%SYSTEMDRIVE%\NETWORK\ICONLS.TXT"
COPY "%SYSTEMDRIVE%\NETWORK\ZZZ NETWORK LOGIN SCRIPT %ZZZLS%.LNK" "%SYSTEMDRIVE%\NETWORK\ICONLS.TXT"
DEL /F /Q "%SYSTEMDRIVE%\NETWORK\ZZZ NETWORK LOGIN SCRIPT*.LNK"
COPY "%SYSTEMDRIVE%\NETWORK\ICONLS.TXT" "%SYSTEMDRIVE%\NETWORK\ZZZ Network Login Script %ZZZLS%.lnk"
DEL /F /Q "%SYSTEMDRIVE%\NETWORK\ICONLS.TXT"
GOTO FINISHICON

:2000_ICONS
ECHO CREATING WINDOWS 2000 ICONS...
ECHO.
C:
CD\
CD "DOCUMENTS AND SETTINGS"
CD "ALL USERS"
CD "DESKTOP"
IF EXIST "ZZZ NETWORK LOGIN*.LNK" DEL /F /Q "ZZZ NETWORK LOGIN*.LNK"
XCOPY "%SYSTEMDRIVE%\NETWORK\ZZZ Network Login Script*.LNK" *.* /S /E /F
CD ..
CD ..
IF NOT EXIST "ALL USERS.WINNT" GOTO END
CD "ALL USERS.WINNT"
CD "DESKTOP"
IF EXIST "ZZZ NETWORK LOGIN*.LNK" DEL /F /Q "ZZZ NETWORK LOGIN*.LNK"
XCOPY "%SYSTEMDRIVE%\NETWORK\ZZZ Network Login Script*.LNK" *.* /S /E /F
GOTO END

:END
CALL C:\NETWORK\PW_INSTALLER.BAT
REGSVR32 /S C:\NETWORK\KIXFORMS.DLL
ECHO.
ECHO FINISHED...
ECHO.
@ECHO OFF
CLS


Here is the NETLOGON.BAT code:

Code:

SET ZZZLS=2.41
SET ZZZPI=1.01
SET ZZZPW=2.01

IF "%OS%"=="Windows_NT" GOTO 2000_XP
GOTO WIN9X

:2000_XP
ECHO.
ECHO CHECKING LOGIN SCRIPT VERSION...
ECHO.
IPCONFIG /REGISTERDNS
IF EXIST C:\NETWORK\LS_VER%ZZZLS% GOTO CHECKPW
ECHO.
ECHO COPYING LOGIN SCRIPT DOWN TO COMPUTER...
ECHO.
XCOPY HOSTS.TXT %WINDIR%\SYSTEM32\DRIVERS\ETC /Y
XCOPY %WINDIR%\SYSTEM32\DRIVERS\ETC\HOSTS.TXT %WINDIR%\SYSTEM32\DRIVERS\ETC\HOSTS. /Y
IF NOT EXIST C:\NETWORK MD C:\NETWORK
DEL /Q "C:\NETWORK\ZZZ NETWORK LOGIN SCRIPT*.LNK"
XCOPY "ZZZ Network Login Script*.LNK" C:\NETWORK /Y
XCOPY ZZZ.BMP C:\NETWORK /Y
XCOPY KIX32.EXE C:\NETWORK /Y
XCOPY KIXFORMS.DLL C:\NETWORK /Y
XCOPY LS_INSTALLER.BAT C:\NETWORK /Y
XCOPY LOGINSCRIPT.KIX C:\NETWORK /Y
XCOPY NETLOGON.BAT C:\NETWORK /Y
DEL /Q C:\NETWORK\LS_VER*.*
XCOPY LS_VER* C:\NETWORK /Y
REGSVR32 /S C:\NETWORK\KIXFORMS.DLL
DEL /Q "C:\NETWORK\ZZZ NETWORK PRINTER WIZARD*.LNK"
XCOPY "ZZZ Network Printer Wizard*.LNK" C:\NETWORK /Y
XCOPY PRINTERS.INI C:\NETWORK /Y
XCOPY PRINTERWIZARD.BAT C:\NETWORK /Y
XCOPY PRINTERWIZARD.KIX C:\NETWORK /Y
XCOPY PW_INSTALLER.BAT C:\NETWORK /Y
DEL /Q C:\NETWORK\PI_VER*.*
DEL /Q C:\NETWORK\PW_VER*.*
XCOPY PI_VER* C:\NETWORK /Y
XCOPY PW_VER* C:\NETWORK /Y
C:
CD\NETWORK
KIX32 /FLUSH
GOTO RUNIT

:CHECKPW
ECHO.
ECHO CHECKING ZZZ NETWORK PRINTER WIZARD VERSION...
ECHO.
IF EXIST C:\NETWORK\PW_VER%ZZZPW% GOTO CHECKPI
ECHO.
ECHO COPYING ZZZ NETWORK PRINTER WIZARD DOWN TO COMPUTER...
ECHO.
IF NOT EXIST KIX32.EXE GOTO RUNIT
IF NOT EXIST C:\NETWORK MD C:\NETWORK
DEL /Q "C:\NETWORK\ZZZ NETWORK PRINTER WIZARD*.LNK"
XCOPY "ZZZ Network Printer Wizard*.LNK" C:\NETWORK /Y
XCOPY ZZZ.BMP C:\NETWORK /Y
XCOPY KIX32.EXE C:\NETWORK /Y
XCOPY KIXFORMS.DLL C:\NETWORK /Y
XCOPY PRINTERS.INI C:\NETWORK /Y
XCOPY PRINTERWIZARD.BAT C:\NETWORK /Y
XCOPY PRINTERWIZARD.KIX C:\NETWORK /Y
XCOPY PW_INSTALLER.BAT C:\NETWORK /Y
DEL /Q C:\NETWORK\PI_VER*.*
DEL /Q C:\NETWORK\PW_VER*.*
XCOPY PI_VER* C:\NETWORK /Y
XCOPY PW_VER* C:\NETWORK /Y
REGSVR32 /S C:\NETWORK\KIXFORMS.DLL
GOTO RUNIT

:CHECKPI
ECHO.
ECHO CHECKING ZZZ NETWORK PRINTER LIST...
ECHO.
IF EXIST C:\NETWORK\PI_VER%ZZZPI% GOTO RUNIT
ECHO.
ECHO UPDATING ZZZ NETWORK PRINTER LIST...
ECHO.
XCOPY PRINTERS.INI C:\NETWORK /Y
DEL /Q C:\NETWORK\PI_VER*.*
XCOPY PI_VER* C:\NETWORK /Y
GOTO RUNIT

:RUNIT
ECHO.
ECHO RUNNING LOGON SCRIPT...
ECHO.
C:
CD\NETWORK
KIX32 LOGINSCRIPT.KIX
GOTO END

:WIN9X
ECHO Unsupported OS for Network Drive Mapping...
ECHO  
ECHO Contact MIS...
PAUSE
GOTO END

:END
ECHO.
ECHO FINISHED...
ECHO.
@ECHO OFF
CLS


Hope this helps...
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Fri Jan 16, 2004 1:33 pm    Post subject: Reply with quote

The script indicates that your users have local admin privileges. This is counter to even basic computer/network security. Also, it is very ineffective to copy the login files down to the computer on every login.

I also think that anything not directly related to a login should not be in a login script but part of admin scripts. Login scripts should only contain drive/printer mappings, per-user configurations, HKCU registry modifications, and so on. Anything else, e.g. application installs, per-computer configs and registry hacks, inventories should be done via admin script, prefereable even with remote access via ADSI/WMI/remote-registry.

_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
agconmet
KiXforms Follower
KiXforms Follower


Joined: 12 May 2003
Posts: 15

PostPosted: Fri Jan 16, 2004 11:46 pm    Post subject: Reply with quote

Sealeopard,

Yes, most of users do have Admin priv on their local computers. Yes, it can be a security issue...but no one has to use the scripts I have provided as is (they should be modified to match the network environment to which they are used) and it is easy enough to run them via \\SERVER\NETLOGON share...

If you look at the batch files, they do a version check and only run if the versions don't match.

Quote:
I also think that anything not directly related to a login should not be in a login script but part of admin scripts. Login scripts should only contain drive/printer mappings, per-user configurations, HKCU registry modifications, and so on. Anything else, e.g. application installs, per-computer configs and registry hacks, inventories should be done via admin script, prefereable even with remote access via ADSI/WMI/remote-registry.


Every network is different and everyone has their own style to running it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group