Monday, September 23, 2013

WSUS Clients wont update (Server or Workstation) Reset Settings/Cookie Script

Imaging the server or workstation clients in VMware or by other means leaves the WSUS client session cookie in the registry.  Once the new imaged server/workstation is then connected back to WSUS the session cookie points the original computer object.  This will only update one system in WSUS and the name will flip flop as each system tries to update itself in WSUS which leaves you wondering "It was there just a moment ago??"

The following script resolves this be resetting client WSUS settings outside of GPO enforced WSUS location:

REM stop the Automatic Updates service
net stop wuauserv
 

REM Delete SusClientID and AccountDomainSid registry keys
SET WU_KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate
reg delete %WU_KEY% /v SusClientID /f
reg delete %WU_KEY% /v  AccountDomainSid /f

 

REM Delete registry keys may contain old SUS info
reg delete “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” /f
 

REM Start the Automatic Updates service
net start wuauserv
 

REM Roll the WU Client…
wuauclt /resetauthorization /detectnow