Windows Update Trouble Shooting

# abfragen, welche Updates installiert sind mit der powershell:
   wmic QFE list brief | more
# oder
   Get-HotFix


MS: Installiere PowershellGet:

# powershell als Administrator starten
# Installieren der neuesten Version von PowerShellGet
   Install-PackageProvider -Name NuGet -Force

# schließe die powershell und starte eine neue powershell sitzung

# PowerShell-Katalog als vertrauenswürdiges Repository zu registrieren
   Set-PSRepository -Name PSGallery -InstallationPolicy Trusted


# installiere das powershell-module 'PSWindowsUpdate'
   Install-Module -Name PSWindowsUpdate -Force


Windows Update Fehler Nummern

MS Windows Update – zusätzliche Ressourcen:

# cmd als Administrator:
   net stop wuauserv
   rd /s /q %systemroot%\SoftwareDistribution
   net start wuauserv

# Manuelles Zurücksetzen Windows Update Komponenten
# cmd normal starten:
   net stop bits
   net stop wuauserv
   net stop cryptsvc

   del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"

####################################################################################
# agressive Methode, wenn das vorherige nicht funktioniert hat, ansonsten überspringen:
   Ren %Systemroot%\SoftwareDistribution\DataStore DataStore.bak
   Ren %Systemroot%\SoftwareDistribution\Download Download.bak
   Ren %Systemroot%\System32\catroot2 catroot2.bak

   sc.exe sdset bits D:(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)
   sc.exe sdset wuauserv D:(A;;CCLCSWRPLORC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)
####################################################################################

   cd /d %windir%\system32

   regsvr32.exe atl.dll
   regsvr32.exe urlmon.dll
   regsvr32.exe mshtml.dll
   regsvr32.exe shdocvw.dll
   regsvr32.exe browseui.dll
   regsvr32.exe jscript.dll
   regsvr32.exe vbscript.dll
   regsvr32.exe scrrun.dll
   regsvr32.exe msxml.dll
   regsvr32.exe msxml3.dll
   regsvr32.exe msxml6.dll
   regsvr32.exe actxprxy.dll
   regsvr32.exe softpub.dll
   regsvr32.exe wintrust.dll
   regsvr32.exe dssenh.dll
   regsvr32.exe rsaenh.dll
   regsvr32.exe gpkcsp.dll
   regsvr32.exe sccbase.dll
   regsvr32.exe slbcsp.dll
   regsvr32.exe cryptdlg.dll
   regsvr32.exe oleaut32.dll
   regsvr32.exe ole32.dll
   regsvr32.exe shell32.dll
   regsvr32.exe initpki.dll
   regsvr32.exe wuapi.dll
   regsvr32.exe wuaueng.dll
   regsvr32.exe wuaueng1.dll
   regsvr32.exe wucltui.dll
   regsvr32.exe wups.dll
   regsvr32.exe wups2.dll
   regsvr32.exe wuweb.dll
   regsvr32.exe qmgr.dll
   regsvr32.exe qmgrprxy.dll
   regsvr32.exe wucltux.dll
   regsvr32.exe muweb.dll
   regsvr32.exe wuwebv.dll

   netsh winsock reset

   net start bits
   net start wuauserv  
   net start cryptsvc

# IONOS:
  net stop wuauserv
  net stop cryptsvc
  net stop bits
  net stop msiserver
  ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
  ren C:\Windows\System32\catroot2 catroot2.old
  net start wuauserv
  net start cryptsvc
  net start bits
  net start msiserver

# prüfe mit der Powershell die Erreichbarkeit des WSUS-Servers:
  Test-NetConnection -ComputerName <Name des WSUS-Servers> -Port 8530 -InformationLevel "Detailed"
  Test-NetConnection -ComputerName <Name des WSUS-Servers> -Port 8531 -InformationLevel "Detailed"
  Test-NetConnection -ComputerName <Name des WSUS-Servers> -Port 80 -InformationLevel "Detailed"
  Test-NetConnection -ComputerName <Name des WSUS-Servers> -Port 443 -InformationLevel "Detailed"
# prüfe route diagnostics zu WSUS-Server
Test-NetConnection -ComputerName "<name des WSUS Servers>" -DiagnoseRouting -InformationLevel Detailed

## Firewall anhalten oder neun starten
# beendet die Firewall, auch nach einem Neustart aus !!!
# cmd als Admin
   netsh advfirewall set allprofiles state off
   netsh advfirewall set allprofiles state on

## Erneutes Registrieren des Windows-Clients/Servers in WSUS
# auf dem srv2019:
   gpupdate /force
   wuauclt /detectnow
   wuauclt /resetauthorization /detectnow
   wuauclt /reportnow

# https://blog.oberhf.de/wsus-befehle-fuer-clients/

  type %Program Files%\Update Services\LogFiles\SoftwareDistribution.log | findstr /I TLS


# Aktivieren der zusätzlichen Protokollierungsoptionen,
   mkdir c:\Windows\Debug\UserMode
   reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Diagnostics"  /v GPsvcDebugLevel /t REG_DWORD /d 0x30002
# in %windir%\debug\usermode liegt dann die Datei
   GPSvc.log


Links:
ct: Windows Update (german)
MS: Verwalten zusätzlicher Windows Update-Einstellungen (german)
MS: Firewall Rules (english)
MS: Microsoft Public IP Space (english)