WSUS客户端配置脚本(WSUS_Client_Configure_Script)
过完年后有一个WSUS的部署项目,但又涉及到大量没加入域的客户端。提前写好一个WSUS客户端的配置脚本,以方便年后的项目手到擒来。哈哈。。。。
[code]'==========================================================================
'
' VBScript Source File
'
' NAME: WSUS_Client_Configure
'
' AUTHOR: FuLin , Systems Service Department , Chengdu Microsoft Technology Center
' DATE : 2007/2/20
'
' COMMENT: This Script Can Be Configure WSUS Client.
'
'==========================================================================
ON Error Resume Next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oreg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
'HTTP(S) URL of the WSUS server used by Automatic Updates and (by default) API callers. This policy is paired with WUStatusServer; both must be set to the same value in order for them to be valid.
strKeyPath = "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
strValueName = "WSUS_Server_URL"
strValue = " WUServer "
oreg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'The HTTP(S) URL of the server to which reporting information will be sent for client computers that use the WSUS server configured by the WUServer key. This policy is paired with WUServer; both must be set to the same value in order for them to be valid.
strKeyPath = "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
strValueName = "WSUS_Server_URL"
strValue = "WUStatusServer"
oreg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
' --------------------------------------------------------------
strKeyPath2 = "Software\Policies\Microsoft\Windows\WindowsUpdate\AU"
strValueName = "AUOptions"
dwValue = 2
' Range = 2|3|4|5
' 2 = Notify before download.
' 3 = Automatically download and notify of installation.
' 4 = Automatic download and scheduled installation. (Only valid if values exist for ScheduledInstallDay and ScheduledInstallTime.)
' 5 = Automatic Updates is required, but end users can configure it.
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName,dwValue
strValueName = "AutoInstallMinorUpdates"
dwValue = 0
' Range = 0|1
' 0 = Treat minor updates like other updates.
' 1 = Silently install minor updates.
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName,dwValue
strValueName = "NoAutoRebootWithLoggedOnUsers"
dwValue = 0
' Range = 0|1;
' 1 = Logged-on user gets to choose whether or not to restart his or her computer.
' 0 = Automatic Updates notifies user that the computer will restart in 5 minutes.
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName,dwValue
strValueName = "RebootWarningTimeout"
dwValue = 15
' Range=n; where n=Time In minutes (1-30).
' Length, In minutes, of the restart warning countdown after installing updates With a deadline or scheduled updates.
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName,dwValue
strValueName = "NoAutoUpdate"
dwValue = 0
' Range = 0|1
' 0 = Enable Automatic Updates.
' 1 = Disable Automatic Updates.
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName,dwValue
strValueName = "ScheduledInstallDay"
dwValue = 0
' Range = 0|1|2|3|4|5|6|7
' 0 = Every day.
' 1 through 7 = The days of the week from Sunday (1) to Saturday (7).
' (Only valid if AUOptions equals 4.)
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName,dwValue
strValueName = "ScheduledInstallTime"
dwValue = 12
' Range = n; where n = the time of Day In 24-Hour format (0-23).
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName,dwValue[/code]



可以加写注释吗?
脚本当然可以加注释[smile]