Thanks James!

 

Much appreciated! I’ll definitely take a look at this!!

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Blair, James
Sent: 07 December 2004 15:19
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] GPO/SUS Issue

 

Peter,

 

Use the below script...I use it for all my workstaion RIS images and unattended CD images...Once it updates (10-20 minutes +) depending on available updates, sizes, locations etc I place the workstation/s in their respective OU's which have a Group Policy that "regulates" the flow of updates...the SUS forums on the web are a wealth of knowlege...Author of the script is at the top so he desertves any credit...

 

James

 

'Author: Joe Ostrander ([EMAIL PROTECTED])
'Description: Kick off a windows update
'Date: 10/24/2003

on error resume next

Set WshShell = WScript.CreateObject("WScript.Shell")

'change this next line to match your environment
myserver="http://%PutServerNameHere%"

'don't change these lines
starttime="23"
olddate="2000.01.01 00:00:01"

'stop the Windows update service
WshShell.Run "net stop wuauserv"


'Change registry entries (after reboot Group Policy can change them back to original settings)
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\WUServer", myserver
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\WUStatusServer", myserver

WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\AUOptions", 4,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate", 0,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallDay", 0,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallTime", starttime,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\RescheduleWaitTime", 1,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers", 0,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer", 1,"REG_DWORD"

WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUState", 2,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUOptions", 4,"REG_DWORD"
WshShell.RegDelete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\LastWaitTimeout"

'wait a bit, just to make sure the update service stopped ok
WScript.Sleep 20000
WshShell.Run "net start wuauserv"

'Keep checking to see if there are installs pending
Do While val <> "5"
val=WshShell.RegRead ("HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUState")
WScript.Sleep 1000
Loop

'If installs are pending, stop the service
'WScript.echo "Ready!"
WshShell.Run "net stop wuauserv"
WScript.Sleep 20000

'change the scheduled install date to a PAST date
WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\ScheduledInstallDate",olddate

'start the service. it will check the scheduledinstalldate & think it missed its time
'and then begin installing after the rescheduled wait time
WshShell.Run "net start wuauserv"

 


From: [EMAIL PROTECTED] on behalf of Peter Johnson
Sent: Tue 7/12/2004 8:42 PM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] GPO/SUS Issue

Hi all

 

I’m trying to troubleshoot and confirm whether or not my machines are actually getting the GPO’s settings and talking to my local SUS server for update purposes. Does anyone know of a way to force a Windows Update Client to actually go and check for updates?

 

I know which log file I need to check I just need to force a connection/check by the client.

 

Any help would be appreciated.

 

Regards

Peter Johnson

Reply via email to