|
I have been using Kixtart for a while but I am not much at scripting. I would appreciate any advice as to how I can simplify my login script. Especially with the "IF INGROUP" statements. Here is my kix script. Thanks for the help.
;************************************************************ ;$Variables ;************************************************************
$OS = (@PRODUCTTYPE) $IP = (@IPADDRESS0) $AVIP = val(substr(@ipaddress0, 1, 3)) $DNS = READVALUE ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VxD\MSTCP", "NAMESERVER") ;************************************************************ ; Setting Time Server ; **********************************************************
SETTIME "\\RSHDR"
;********************************************************** ;Update KIX files ;*********************************************************** IF EXIST (C:\WINDOWS\KX32.DLL) = 0 COPY "\\RSHDR\NETLOGON\*.DLL" "C:\WINDOWS" /H COPY "\\RSHDR\NETLOGON\*.DLL" "C:\WINDOWS\SYSTEM" /H COPY "\\RSHDR\NETLOGON\KIX32.EXE" "C:\WINDOWS" /H COPY "\\RSHDR\NETLOGON\KIX32.EXE" "C:\WINDOWS\SYSTEM" /H ENDIF
;************************************************************* ; Check For Department Group Privileges ;************************************************************* if ingroup(BIOMED) use I: "\\3MAPC\BIOMED$" ENDIF
if ingroup(BUSOFF) use I: "\\3MAPC\BUSOFF$" ;use R: "\\RH_SERVER\CIS" ENDIF
if ingroup(CANCER_CTR) use I: "\\3MAPC\CANCER_CTR$" ENDIF
if ingroup(CARDIOSHR) use I: "\\3MAPC\CARDIO$" ENDIF
if ingroup(Cathlab) use I: "\\3MAPC\CATHLAB$" ENDIF if ingroup(COMPLIANCE) use I: "\\3MAPC\COMPLIANCE$" use J: "\\3MAPC\QUALITY$" ENDIF
if ingroup(DADEVILLE) use I: "\\3MAPC\DADEVILLE$" ENDIF
if ingroup(EDUCATION) use I: "\\3MAPC\EDUCATION$" use J: "\\3MAPC\QUALITY$" ENDIF
if ingroup(ER) use I: "\\3MAPC\ER$" ENDIF
if ingroup(EXECUTIVE) use I: "\\3MAPC\EXECUTIVE$" ENDIF
if ingroup(FISCALSER) use I: "\\3MAPC\FISCALSER$" ENDIF if ingroup(HOSPICE) use I: "\\3MAPC\HOSPICE$" ENDIF
if ingroup(HR) use I: "\\3MAPC\HR$" ENDIF if ingroup(IS) use I: "\\3MAPC\IS$" ENDIF
if ingroup(MAINT) use I: "\\3MAPC\MAINT$" ENDIF
if ingroup(MEDREC) use I: "\\3MAPC\MEDREC$" ENDIF
if ingroup(NURSING) use I: "\\3MAPC\NURSING$" ENDIF if ingroup(RADIOLOGY) use I: "\\3MAPC\RAD$" ENDIF
if ingroup(UR) use I: "\\3MAPC\UR$" ENDIF ;************************************************************* ;Check for Special Group Privileges ;************************************************************* if ingroup(ADMIN) use W: "\\RSH-BG1\PDC$" use X: "\\RSHDR\BDC$" use K: "\\INETGTWY\MSPLOGS$" use J: "\\3MAPC\RMC$" ENDIF
if ingroup(Cath_Rad) use I: "\\3MAPC\CATHLAB$" use J: "\\3MAPC\RAD$" ENDIF
if ingroup(EEG) use K: "\\3MAPC\EEG$" ENDIF
if ingroup(EXECUTIVE) and ingroup(EDUCATION) use K: "\\3MAPC\EXECUTIVE$" ENDIF
if ingroup(HOSPICE_DB) use L: "\\3MAPC\HOSPICE_DB$" ENDIF
if ingroup(INTRANET) and EXIST (C:\WINDOWS\Desktop\RMCINT~1.lnk) = 1 COPY "\\RSHDR\NETLOGON\globe.ico" "C:\WINDOWS" COPY "\\RSHDR\NETLOGON\rmcint~1.url" "C:\WINDOWS\DESKTOP" DEL "C:\WINDOWS\Desktop\RMCINT~1.lnk" ENDIF
if ingroup(INTRANET) and EXIST (C:\WINDOWS\Desktop\rmcedu~1.url) = 0 COPY "\\RSHDR\NETLOGON\rmcedu.ico" "C:\WINDOWS" COPY "\\RSHDR\NETLOGON\rmcedu~1.url" "C:\WINDOWS\DESKTOP" ENDIF
if ingroup(NURSE_MGR) use K: "\\3MAPC\NURSE_MGR$"
ENDIF
if ingroup(NURSE_ORIENTATION) use J: "\\3MAPC\NURSE_ORIENT$" ENDIF if ingroup(PRESSGNY_FULL) use N: "\\3MAPC\PRESSGANEY$" ENDIF if ingroup(PFT) use P: "\\3MAPC\PFT$" ENDIF
if ingroup(PFT_Archv) use O: "\\3MAPC\PFT_Archv$" ENDIF
if ingroup(PRESSGNY_READ) use N: "\\3MAPC\PRESSGANEY$" ENDIF
if ingroup(SELF_PAY) use K: "\\3MAPC\SELF_PAY$" ENDIF
if ingroup(TIMETRAK) use L: "\\3MAPC\TIMETRAK$" ENDIF if ingroup(NURSE_ADMIN) use "*" /DELETE use I: "\\3MAPC\NURSING$" use L: "\\3MAPC\CANCER_CTR$" use M: "\\3MAPC\ER$" use K: "\\3MAPC\NURSE_MGR$" use J: "\\3MAPC\NURSE_ORIENT$" ENDIF
;Letters used=I,J,K,L,M,N,O,P,W,X ;******************************************************************************** ; Map Personal Home Directory / drive to R: ;******************************************************************************** if Exist ("\\3MAPC\@userid$") = 1 use R: "\\3MAPC\@userid$" ENDIF
;******************************************************************************** ;Registry DNS Changes ;******************************************************************************** ;IF $DNS = "199. 0. 66. 6" ; ? "DONE" ;ELSE ; WRITEVALUE ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VxD\MSTCP", "NAMESERVER", "199. 0. 66. 6", "REG_SZ") ;ENDIF
;******************************************************************************** ;User Logging to \\3MAPC\LOG$ ;******************************************************************************** $filename="@userid";+"@TIME" $key="@date"+" @time" $outfile="\\3mapc\log$\@Day\$filename.txt" $log = @date, @ipaddress $rc1 = WriteProfileString($outfile,"$key","__IPAddress","@IPADDRESS0") $rc2 = WriteProfileString($outfile,"$key","__UserName","@USERID") $rc3 = WriteProfileString($outfile,"$key","__WorkStationName","@WKSTA") $rc4 = WriteProfileString($outfile,"$key","__LastLogin","@Time") $rc5 = WriteProfileString($outfile,"$key","__DNS","$DNS") $rc6 = WriteProfileString($outfile,"$key","__OperatingSystem","@PRODUCTTYPE")
;******************************************************************************** ;SynapseAE Security ;******************************************************************************** IF "@userid" = synapseae SENDMESSAGE (ME, @IPADDRESS0 + " logged in as SYNAPSEAE") ENDIF
;******************************************************************************** ;Antivirus Install ;******************************************************************************** if $AVIP = "128" RUN "\\3mapc\OFCSCAN\AUTOPCC.exe" ELSE ENDIF
;********************************************************************************
COOKIE1 EXIT
|