Created
April 29, 2014 12:03
-
-
Save rverrips/11398191 to your computer and use it in GitHub Desktop.
Reset WSUS Auth Key on PC's that were mirrorred without running SYSPREP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: check_wsus.cmd | |
:: | |
:: Logon script that checks if workstation token exists in wsus-check$ | |
:: If it exists, simply exit, but if not, clears WINDOWSUPDATE registry keys. | |
:: | |
:: Last updated by Roy Verrips ([email protected]) on 30th January 2014 | |
:: | |
set wsus-check=\\xxxxxxx-server-name-----\wsus-check$ | |
if %computername%=="" goto :end | |
if exist %wsus-check%\%computername%.check goto :end | |
date /t >> %wsus-check%\%computername%.check | |
time /t >> %wsus-check%\%computername%.check | |
net stop wuauserv | |
if not exist C:\windows\system32\reg.exe copy $installpath\reg.exe c:\windows\system32 | |
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f >> %wsus-check%\%computername%.check | |
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f >> %wsus-check%\%computername%.check | |
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f >> %wsus-check%\%computername%.check | |
net start wuauserv | |
wuauclt /resetauthorization /detectnow | |
goto :end | |
:end | |
echo ---------------------------------------------- >> %wsus-check%\machineids.txt | |
date /t >> %wsus-check%\machineids.txt | |
time /t >> %wsus-check%\machineids.txt | |
echo %computername% >> %wsus-check%\machineids.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Logon script that checks if workstation token exists in wsus-check$
If it exists, simply exit, but if not, clears WINDOWSUPDATE registry keys and does a reauth