#111715 - 2004-01-13 07:50 AM
Will this login script work?
|
Mandy
Lurker
Registered: 2004-01-13
Posts: 3
|
Hi..I'm new to this and I havnt got a server set up to test it (yet) Part of it is out of a book, some from here and I removed all the statements cos I want to put that into a file on its own..
Can anyone see anything wrong with this script..?
If @dos >= "5.0" $hklms = 'HKEY_LOCAL_MACHINE\SOFTWARE' If 1 <> ReadValue($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync") $ = WriteValue ($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync", "1", "REG_DWORD") EndIf EndIf
If @INWIN=1 GoTo SETVARNT Else GoTo SETVAR95 EndIf
:SETVAR95 Shell "winSET.exe USERNAME=@USERID" Shell "winSET.exe ADDRESS=@ADDRESS" Shell "winSET.exe COMPUTER=@WKSTA" Shell "winSET.exe DOMAIN=@DOMAIN" Shell "winSET.exe COMMENT=@COMMENT" Shell "winSET.exe FULLNAME=@FULLNAME" Shell "winSET.exe HOMEDIR=@HOMEDIR" Shell "winSET.exe HOMESHR=@HOMESHR" Shell "winSET.exe LSERVER=@LSERVER" Shell "winSET.exe PRIV=@PRIV"
GoTo STAGE2
:SETVARNT ;SET varibles on NT clients using SET command
Set USERNAME="@USERID" SETM ADDRESS="@ADDRESS" SETM COMPUTER="@WKSTA" SETM DOMAIN="@DOMAIN" Set COMMENT="@COMMENT" Set FULLNAME="@FULLNAME" Set HOMEDIR="@HOMEDIR" Set HOMESHR="@HOMESHR" Set LSERVER="@LSERVER" Set PRIV="@PRIV"
:STAGE2 ;synchronizing with timeserver SetTime \\S01 EndIf
;delete any previous drive mappings and check for errors Use "*" /DELETE EndIf
;MAP Drives By Group Membership ;Map common drives for Domain Users
If InGroup ("Domain") = 1 Use S: \\S01\shared Use P: \\S01\programs Use H: @HOMESHR EndIf Call LOGSCREEN.SRC
|
|
Top
|
|
|
|
#111717 - 2004-01-13 08:23 AM
Re: Will this login script work?
|
Mandy
Lurker
Registered: 2004-01-13
Posts: 3
|
Reading Windows server 2003 by Mark Minasi
|
|
Top
|
|
|
|
#111718 - 2004-01-13 09:52 AM
Re: Will this login script work?
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: CA
|
My guess is this is Chris G.
Oh, and Welcome to the board.
Anyways... Here is my input on this.
It is more difficult to use the SetOption NoVarInStrings setting, but it will force you
to make sure your script coding is written better.
Code:
Break On
Dim $iRC
$iRC=SetOption('Explicit','On')
$iRC=SetOption('NoVarsInStrings','On')
Dim $HKLMSMWNTCV,$,$LocalAdmin
If @DOS >= '5.0'
$HKLMSMWNTCV = 'HKLM\Software\Microsoft\Windows NT\CurrentVersion'
$LocalAdmin = InGroup(@wksta+'\'+SidToName('S-1-5-32-544'))-1+@INWIN
; Server 2003 should use a GPO to set this sync option
; If GPO not used the user logging on must have Admin rights to modify this key
; I would check if the user is an Admin
;If 1 <> ReadValue($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync")
If $LocalAdmin
; Just writing the key each time without checking the current value is faster
$ = WriteValue ($HKLMSMWNTCV + '\Winlogon', 'RunLogonScriptSync', 1, 'REG_DWORD')
EndIf
EndIf
; As Lonkero said these settings should not be needed anymore
; Using the GOTO statement is legal, but frowned upon in general
;If @INWIN=1
;GoTo SETVARNT
;Else
;GoTo SETVAR95
;EndIf
;:SETVAR95
;Shell "winSET.exe USERNAME=@USERID"
;Shell "winSET.exe ADDRESS=@ADDRESS"
;Shell "winSET.exe COMPUTER=@WKSTA"
;Shell "winSET.exe DOMAIN=@DOMAIN"
;Shell "winSET.exe COMMENT=@COMMENT"
;Shell "winSET.exe FULLNAME=@FULLNAME"
;Shell "winSET.exe HOMEDIR=@HOMEDIR"
;Shell "winSET.exe HOMESHR=@HOMESHR"
;Shell "winSET.exe LSERVER=@LSERVER"
;Shell "winSET.exe PRIV=@PRIV"
;GoTo STAGE2
;:SETVARNT
;SET varibles on NT clients using SET command
;Set USERNAME="@USERID"
;SETM ADDRESS="@ADDRESS"
;SETM COMPUTER="@WKSTA"
;SETM DOMAIN="@DOMAIN"
;Set COMMENT="@COMMENT"
;Set FULLNAME="@FULLNAME"
;Set HOMEDIR="@HOMEDIR"
;Set HOMESHR="@HOMESHR"
;Set LSERVER="@LSERVER"
;Set PRIV="@PRIV"
;:STAGE2
;synchronizing with timeserver
SetTime \\S01
;EndIf
;delete any previous drive mappings and check for errors
Use "*" /DELETE /PERSISTENT
; I did not follow all the IF statements, but looks like you may have one or more EndIf without If
;EndIf
;MAP Drives By Group Membership
;Map common drives for Domain Users
; Not positive but I think DOMAIN is a reserved word.
; InGroup checks group membership. You can use something like
; $MyDomain = @DOMAIN
; If $MyDomain='PHOTOSRUS'
;If InGroup ("Domain") = 1
Use S: '\\S01\shared'
Use P: '\\S01\programs'
; Test and make sure @HOMESHR returns the expected value before attempting to map it
Use H: @HOMESHR
EndIf
; By default KiXtart uses .KIX and .SCR (however screen saver modules also use .SCR
; It would probably be better to get in the habit of using either .KIX or maybe something like
; .KXW (for WKIX32.EXE) and .KXD (for KIX32.EXE) or just .KIX in general
Call LOGSCREEN.SRC
|
|
Top
|
|
|
|
#111720 - 2004-01-14 01:19 AM
Re: Will this login script work?
|
Mandy
Lurker
Registered: 2004-01-13
Posts: 3
|
Hey Thanks for your help, I will go through the manual and hopefully piece it together. Now I have something I know is going to work, it's a little easier..
Question:
What is this part of the script doing?
Break On
Dim $iRC
$iRC=SetOption('Explicit','On')
$iRC=SetOption('NoVarsInStrings','On')
**The "Domain" I just put there instead of the real group name. I was planning to change it back..
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 661 anonymous users online.
|
|
|