Quantcast
Channel: Windows Server Forum
Viewing all articles
Browse latest Browse all 2531

Windows Update search - remote commands not working

$
0
0

Hey Microsoft community,

I have the following issue:

since end of October 2022 some of your windows servers (OS: 2012/R2, 2016) haven't searched for any windows updates, the status I see in the windows update GUI looks like this:

You are up to date (last check: 29.10.2022)

The updates are deployed via Windows Update Server (WSUS, OS: 2012 R2).

When I click on search then Windows Updates can be found, are downloaded and installed properly. This only works when I click on the search button manually. If I use remote commands like this it does NOT work (either I get an error code [OS 2016] or nothing happens [OS 2012]):

Remote commands:

  1. Attempt:

$item = Servername

$s = New-PSSession -computername $item

Invoke-Command -Session $s -ScriptBlock {

net stop Bits
net stop WuAuServ
net stop CryptSvc
Remove-Item -Path C:\Windows\SoftwareDistribution -Recurse
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientIdValidation /f
net start Bits
net start WuAuServ
net start CryptSvc

#OS 2012/R2 wuauclt /resetauthorization /detectnow

#OS 2016 usoclient StartScan

#OS 2019 usoclient StartInteractiveScan

} }

  1. Attempt:

$item = Servername

if (schtasks /create /S $item /RU 'NT AUTHORITY\SYSTEM' /RL 'HIGHEST' /SC ONEVENT /EC Application /f /tn 'cmd' /tr 'usoclient StartScan'){

schtasks /Run /S $item /TN 'cmd'

Start-Sleep -Seconds 2

schtasks /Delete /S $item /TN 'cmd' /F }

Results:

Error 0x80070057 or Updates has never been installed/searched for

It cant be a solution to connect via RDP to every single server and search for windows updates manually, there must be a fix to run the windows update search remotely.

Thanks in advance.


Viewing all articles
Browse latest Browse all 2531


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>