Windows Update Plugin on 2012 R2

CMK version: 2.1.0p24
OS version: Windows Server 2012 R2

Error message: There was an error getting update information. Maybe Windows update is not activated. Error Number: -2147012867)CRIT, Important: 0, Optional: 0

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

OMD[STAR]:~$ cmk --debug -vvn hos-ram-terminalsrv01
WARNING: 1 deprecated plugins will be ignored in Checkmk version 2.2 (see werk #14084): ilo_firmware
Checkmk version 2.1.0p24
Try license usage history update.
Trying to acquire lock on /omd/sites/STAR/var/check_mk/license_usage/next_run
Got lock on /omd/sites/STAR/var/check_mk/license_usage/next_run
Trying to acquire lock on /omd/sites/STAR/var/check_mk/license_usage/history.json
Got lock on /omd/sites/STAR/var/check_mk/license_usage/history.json
Next run time has not been reached yet. Abort.
Releasing lock on /omd/sites/STAR/var/check_mk/license_usage/history.json
Released lock on /omd/sites/STAR/var/check_mk/license_usage/history.json
Releasing lock on /omd/sites/STAR/var/check_mk/license_usage/next_run
Released lock on /omd/sites/STAR/var/check_mk/license_usage/next_run
+ FETCHING DATA
  Source: SourceType.HOST/FetcherType.TCP
[cpu_tracking] Start [7fb442fc0910]
[TCPFetcher] Fetch with cache settings: DefaultAgentFileCache(hos-ram-terminalsrv01, base_path=/omd/sites/STAR/tmp/check_mk/cache, max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
Not using cache (Too old. Age is 49 sec, allowed is 0 sec)
[TCPFetcher] Execute data source
Connecting via TCP to 10.11.10.230:6556 (5.0s timeout)
Detected transport protocol: TransportProtocol.TLS (b'16')
Reading data from agent via TLS socket
Reading data from agent
Detected transport protocol: TransportProtocol.PLAIN (b'<<')
Write data to cache file /omd/sites/STAR/tmp/check_mk/cache/hos-ram-terminalsrv01
Trying to acquire lock on /omd/sites/STAR/tmp/check_mk/cache/hos-ram-terminalsrv01
Got lock on /omd/sites/STAR/tmp/check_mk/cache/hos-ram-terminalsrv01
Releasing lock on /omd/sites/STAR/tmp/check_mk/cache/hos-ram-terminalsrv01
Released lock on /omd/sites/STAR/tmp/check_mk/cache/hos-ram-terminalsrv01
Closing TCP connection to 10.11.10.230:6556
[cpu_tracking] Stop [7fb442fc0910 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=1.8799999989569187))]
  Source: SourceType.HOST/FetcherType.PIGGYBACK
[cpu_tracking] Start [7fb442fc0e20]
[PiggybackFetcher] Fetch with cache settings: NoCache(hos-ram-terminalsrv01, base_path=/omd/sites/STAR/tmp/check_mk/data_source_cache/piggyback, max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=True, use_outdated=False, simulation=False)
Not using cache (Cache usage disabled)
[PiggybackFetcher] Execute data source
No piggyback files for 'hos-ram-terminalsrv01'. Skip processing.
No piggyback files for '10.11.10.230'. Skip processing.
Not using cache (Cache usage disabled)
[cpu_tracking] Stop [7fb442fc0e20 - Snapshot(process=posix.times_result(user=0.010000000000000009, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
+ PARSE FETCHER RESULTS
  Source: SourceType.HOST/FetcherType.TCP
<<<check_mk>>> / Transition NOOPParser -> HostSectionParser
<<<cmk_agent_ctl_status:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<wmi_cpuload:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<uptime>>> / Transition HostSectionParser -> HostSectionParser
<<<mem>>> / Transition HostSectionParser -> HostSectionParser
<<<fileinfo:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<df:sep(9)>>> / Transition HostSectionParser -> HostSectionParser
<<<logwatch>>> / Transition HostSectionParser -> HostSectionParser
<<<services>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_phydisk>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_if>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_processor>>> / Transition HostSectionParser -> HostSectionParser
<<<checkmk_agent_plugins_win:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<dotnet_clrmemory:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<ps:sep(9)>>> / Transition HostSectionParser -> HostSectionParser
<<<wmi_webservices:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
Transition HostSectionParser -> NOOPParser
<<<check_mk:cached(1687160917,7200)>>> / Transition NOOPParser -> HostSectionParser
<<<windows_updates:cached(1687158426,14400)>>> / Transition HostSectionParser -> HostSectionParser
<<<win_license:cached(1687144019,86400)>>> / Transition HostSectionParser -> HostSectionParser
Transition HostSectionParser -> NOOPParser
<<<local:sep(0)>>> / Transition NOOPParser -> HostSectionParser
<<<systemtime>>> / Transition HostSectionParser -> HostSectionParser
No persisted sections
  -> Add sections: ['check_mk', 'checkmk_agent_plugins_win', 'cmk_agent_ctl_status', 'df', 'dotnet_clrmemory', 'fileinfo', 'local', 'logwatch', 'mem', 'ps', 'services', 'systemtime', 'uptime', 'win_license', 'windows_updates', 'winperf_if', 'winperf_phydisk', 'winperf_processor', 'wmi_cpuload', 'wmi_webservices']
  Source: SourceType.HOST/FetcherType.PIGGYBACK
No persisted sections
  -> Add sections: []
Received no piggyback data
Received no piggyback data
[cpu_tracking] Start [7fb442fc9f10]
value store: synchronizing
Trying to acquire lock on /omd/sites/STAR/tmp/check_mk/counters/hos-ram-terminalsrv01
Got lock on /omd/sites/STAR/tmp/check_mk/counters/hos-ram-terminalsrv01
value store: loading from disk
Releasing lock on /omd/sites/STAR/tmp/check_mk/counters/hos-ram-terminalsrv01
Released lock on /omd/sites/STAR/tmp/check_mk/counters/hos-ram-terminalsrv01
CPU utilization      Total CPU: 0%
Check_MK Agent       Version: 2.1.0p24, OS: windows, Last update: Mar 20 2023 09:24:16, Agent plugins: 3, Local checks: 4
Disk IO SUMMARY      Read: 0.00 B/s, Write: 27.1 kB/s, Latency: 857 microseconds
Filesystem C:/       56.12% used (44.60 of 79.48 GB), trend: -60.35 MB / 24 hours
Interface vmxnet3 Ethernet Adapter [1], (Connected), Speed: 10 GBit/s, In: 2.25 kB/s (<0.01%), Out: 23.0 kB/s (<0.01%)
Last-Update          15.06.2023, Cache generated 5 hours 3 minutes ago, cache interval: 1 day 0 hours, elapsed cache lifespan: 21.05%
Memory and pagefile  RAM: 42.9% - 2.57 GB of 6.00 GB, Commit charge: 37.65% - 2.63 GB of 7.00 GB
OS-Version           Microsoft Windows Server 2012 R2 Datacenter, Cache generated 5 hours 4 minutes ago, cache interval: 1 day 0 hours, elapsed cache lifespan: 21.12%
Service Summary      Autostart services: 69, Stopped services: 3
System Time          Offset: 129 ms
System Updates       (There was an error getting update information. Maybe Windows update is not activated. Error Number: -2147012866)(!!), Important: 0, Optional: 0
Uptime               Up since Jun 15 2023 05:08:35, Uptime: 4 days 5 hours
Windows License      Software is Licensed
No piggyback files for 'hos-ram-terminalsrv01'. Skip processing.
No piggyback files for '10.11.10.230'. Skip processing.
[cpu_tracking] Stop [7fb442fc9f10 - Snapshot(process=posix.times_result(user=0.029999999999999805, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.030000001192092896))]
[agent] Success, execution time 1.9 sec | execution_time=1.910 user_time=0.040 system_time=0.000 children_user_time=0.000 children_system_time=0.000 cmk_time_agent=1.870

Hi
We have over 100 Windows Servers which are working fine with this plugin.
But since 2 weeks we have problems with Server 2012 R2.
The difference what I see to another working server, that the script echoes a ? at the start of the output:
Selection_001-10:12:15

Windows Update Check in the GUI is working properly:
Selection_001-10:12:03

Strange, If i connect to a buggy server and restart checkMK service, it works again, but fail the next day…