#123375 - 2004-07-20 07:33 PM
Suggestions for SUS script
|
pgoss
Fresh Scripter
Registered: 2004-05-12
Posts: 5
|
I am extremely new to KiXtart so please go easy on me. My current script looks like this Code:
CLS ;REM MAP DRIVE FOR J & K & O drive mapping IF INGROUP ("Domain\Domain Users") USE K: /DELETE /PERSISTENT USE K: "\\Server\Share1" /PERSISTENT USE J: /DELETE /PERSISTENT USE J: "\\Server\Share2" /PERSISTENT USE o: /DELETE /PERSISTENT USE o: "\\Server\Share3" /PERSISTENT ENDIF
EXIT Obviously this is very basic, now I have been asked to include a reg file that will create the correct entries for our SUS server. I feel it would be faster/easier to include the reg entries with in the kix script instead of making an external call. Only problem, I really have no idea where to begin. Does anyone have any basic scripts that I use as a template?
thanks
|
|
Top
|
|
|
|
#123377 - 2004-07-20 07:53 PM
Re: Suggestions for SUS script
|
pgoss
Fresh Scripter
Registered: 2004-05-12
Posts: 5
|
Quote:
Is this a multi-domain network, or would not basically everybody be in "Domain\Domain Users" negating the need for InGroup()?
This is a single domain, but I do have two groups for the SUS testing. I have a test group and then I have everyone else. I only need for the reg entries to get placed in there once but I do need two different SUS server locations.
Quote:
Why do you map drives as persistent if they get remapped on every logon?
I inherited the script from the previous admin so I just left it alone. I prefer vbs and already have the scripts created there for a manual run but I figure I can always use more knowledge on general scripting.
Quote:
How many reg entries are in your reg merge file? It basically boils down to numbers whether or not to hand code every line in the reg merge file into KiX code
Not that many, somewhere in the nieghborhood of 6 entries. I will take a look at the writevalue info
thanks
Edited by pgoss (2004-07-20 07:55 PM)
|
|
Top
|
|
|
|
#123379 - 2004-07-29 02:07 AM
Re: Suggestions for SUS script
|
rhodwyn
Lurker
Registered: 2004-07-29
Posts: 1
|
We use something very much like this in our environment. I've taken a code snippet from our function file and login scripts. Inside the InstallSUS function are comments to indicate time of day, what to do etc. I altered slightly from our environment so make sure you test before deployment!
All the registry information comes from SUS deployment white paper at Microsoft. Adapt for your needs. Code:
;This part would go in the regular section of your login ;script. Select Case InGroup("FirstGroup") ; First AD group pointing to SUS 1 InstallSUS("YourFirstSUSServer") ; SUS server 1 no HTTP:// Case InGroup("SecondGroup") ; Second AD group pointing to SUS 2 InstallSUS("YourSecondSUSServer") ; SUS server 2, no HTTP:// Case 1 ?"No SUS configuration for this group." EndSelect
;Here to the end you can put at the end of your script ; or you can put it into a separate file and use 'call' ; command to load it before script processing. This ; part actually does all the work. Function InstallSUS($LOCALSUS) $SUSCONFIG=ReadValue("HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate", "WUServer" )
If $SUSCONFIG="http://$LOCALSUS/" ?"SUS is already configured at server $LOCALSUS." Else ?"Setting up SUS for your computer." ?"Your SUS server is $LOCALSUS." ?"Stopping Windows Update Service" Shell "%COMSPEC% /e:1024 /c net stop wuauserv" ?"Writing parameter values." AddKey("hkey_local_machine\software\policies\microsoft\windows\windowsupdate") AddKey("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au") $NUL=WriteValue("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au", "RescheduleWaitTime", "00000005", "REG_DWORD" )
$NUL=WriteValue("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au", "NoAutoRebootWithLoggedOnUsers", "1", "REG_DWORD" )
$NUL=WriteValue("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au", "NoAutoUpdate", "00000000", "REG_DWORD" )
; Automatically download AND install updates $NUL=WriteValue("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au", "AUOptions", "00000004", "REG_DWORD" ) ; Deploy every day $NUL=WriteValue("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au", "ScheduledInstallDay", "00000000", "REG_DWORD" ) ; Install time 13:00 $NUL=WriteValue("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au", "ScheduledInstallTime", "0000000d", "REG_DWORD" ) $NUL=WriteValue("hkey_local_machine\software\policies\microsoft\windows\windowsupdate\au", "UseWUServer", "00000001", "REG_DWORD" ) $NUL=WriteValue("HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate", "WUServer", "http://$LOCALSUS/", "REG_SZ" ) $NUL=WriteValue("HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate", "WUStatusServer", "http://$LOCALSUS/", "REG_SZ" ) $WUAUSERV=ReadValue("hkey_local_machine\system\CurrentControlSet\Services\wuauserv", "Start" ) If $WUAUSERV="2" ?"Automatic Updates already set to start Automatically." Else $NUL=WriteValue("hkey_local_machine\system\CurrentControlSet\Services\wuauserv", "Start", "2", "REG_DWORD" ) EndIf ?"Restarting Windows Update Service." Shell "%COMSPEC% /e:1024 /c net start wuauserv" EndIf EndFunction
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|