{"id":1077,"date":"2021-02-23T16:09:39","date_gmt":"2021-02-23T22:09:39","guid":{"rendered":"http:\/\/zewwy.ca\/?p=1077"},"modified":"2021-02-23T16:10:39","modified_gmt":"2021-02-23T22:10:39","slug":"get-windows-server-out-of-stuck-update-state","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2021\/02\/23\/get-windows-server-out-of-stuck-update-state\/","title":{"rendered":"Get Windows Server out of Stuck Update State"},"content":{"rendered":"<p>I probably should be a bit more clear, this post will cover how I managed to get a Windows Server 2016 to &#8220;check for updates&#8221; when it had gone wrong and was stuck looping (checking) and failing where it replaces the &#8220;check for updates&#8221; button with nothing other than &#8220;retry&#8221;.<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/xSWkDoP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/xSWkDoP.png\" alt=\"\" width=\"839\" height=\"291\" \/><\/a><\/p>\n<p>This happened after clicking &#8220;Search Microsoft Online for Updates&#8221; in which case it found a couple that were not approved by WSUS or not selected as category&#8217;s that WSUS actually downloads.<\/p>\n<p>Funny in this case after I did what will be mentioned below, clicking retry did just start checking again, and then stated &#8220;Your device is up to date&#8221;.<\/p>\n<p>So ok it worked that time, but what I discovered at the time, was that there&#8217;s a <a href=\"https:\/\/social.technet.microsoft.com\/Forums\/en-US\/fbc6bf0e-e1e0-4868-9af1-735f60e4ead8\/usoclient?forum=win10itprogeneral\">new command to use on the backend (command line)<\/a> to do the needful when the UI doesn&#8217;t have the appropriate button available. Like usual Microsoft fashion, notifying stakeholders was poor, and so was an documentation.<\/p>\n<p>Now this isn&#8217;t the first time I discussed issues around Windows update, in particular around the tool MS has given Syadmins to do the needful; WSUS. Such as <a href=\"https:\/\/zewwy.ca\/index.php\/2019\/08\/15\/systems-not-showing-up-in-wsus-console\/\">this time, when clients are not showing up within WSUS after clearly showing they had applied the GPOs (registries) required and no network issues between them<\/a>, or <a href=\"https:\/\/zewwy.ca\/index.php\/2019\/10\/03\/cu-update-not-showing-in-wsus\/\">this time CU updates weren&#8217;t being downloaded by WSUS although clearly the types and categories were fully correct<\/a>.<\/p>\n<p>In this case however instead the issue was simply what commands to use, as stated within the original person asking the question in the TechNet link above &#8220;Since wuauclt has been depreciated in windows 10, I was googling what has replaced it.<\/p>\n<p>I found that usoclient is what has replaced this command for windows update in the command line.\u00a0&#8221;<\/p>\n<p>What authoritative source is there for this claim, <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/get-started\/deprecated-features\">well I found this<\/a>&#8230;<\/p>\n<p>&#8220;The\u00a0<strong>wuauclt.exe \/detectnow<\/strong>\u00a0command has been removed and is no longer supported. To trigger a scan for updates, do either of the following:<\/p>\n<ul>\n<li>Run these PowerShell commands:\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-powershell\" data-author-content=\"$AutoUpdates = New-Object -ComObject &quot;Microsoft.Update.AutoUpdate&quot; $AutoUpdates.DetectNow() \"><span class=\"hljs-variable\">$AutoUpdates<\/span> = <span class=\"hljs-pscommand\">New-Object<\/span><span class=\"hljs-parameter\"> -ComObject<\/span> <span class=\"hljs-string\">\"Microsoft.Update.AutoUpdate\"<\/span>\r\n<span class=\"hljs-variable\">$AutoUpdates<\/span>.DetectNow()\r\n<\/code><\/pre>\n<\/li>\n<li>Alternately, use this VBScript:\n<pre class=\"has-inner-focus\" tabindex=\"0\"><code class=\"lang-vb\" data-author-content=\"Set automaticUpdates = CreateObject(&quot;Microsoft.Update.AutoUpdate&quot;) automaticUpdates.DetectNow() \"><span class=\"hljs-keyword\">Set<\/span> automaticUpdates = CreateObject(<span class=\"hljs-string\">\"Microsoft.Update.AutoUpdate\"<\/span>)\r\nautomaticUpdates.DetectNow()<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>&#8221;<\/p>\n<p>Funny thing about this is I found that wuauclt \/reportnow still works in Server 2016, as noted in my other blog posts. I generally didn&#8217;t use \/detectnow. However what I found was that the new commands did work for me.<\/p>\n<p>Such as these as mentioned from Spiceworks:<\/p>\n<p>&#8220;Start checking for updates: UsoClient StartScan<\/p>\n<p>Start downloading Updates: UsoClient StartDownload<\/p>\n<p>Start installing the downloaded updates: UsoClient StartInstall<\/p>\n<p>Restart your device after installing the updates: UsoClient RestartDevice<\/p>\n<p>Check, Download and Install Updates: UsoClient ScanInstallWait&#8221;<\/p>\n<p>Then of course these as mentioned in the TechNet post:<\/p>\n<p>&#8220;RefreshSettings \u2013 used to quickly enact any settings changes<br \/>\nRestartDevice \u2013 as the name implies, it restarts the device. Can be used in a script to allow updates to finish installing on next boot.<br \/>\nResumeUpdate \u2013 used to tell the tool to resume updating after a reboot.<br \/>\nStartDownload \u2013 initiates a full download (from Microsoft) of existing updates<br \/>\nStartInstall \u2013 kicks-off the installation of the downloaded updates<br \/>\nScanInstallWait \u2013 Combined Scan Download Install<br \/>\nStartInteractiveScan \u2013 we\u2019ve yet to get this one to work, but it suggests that the process may work in a GUI<br \/>\nStartScan \u2013 kicks-off a regular scan&#8221;<\/p>\n<p>While it is nice to see something available, it would be nice if MS made a more formal announcement of the deprecation and the replacements.<\/p>\n<p>Hope this helps someone.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I probably should be a bit more clear, this post will cover how I managed to get a Windows Server 2016 to &#8220;check for updates&#8221; when it had gone wrong and was stuck looping (checking) and failing where it replaces the &#8220;check for updates&#8221; button with nothing other than &#8220;retry&#8221;. This happened after clicking &#8220;Search &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2021\/02\/23\/get-windows-server-out-of-stuck-update-state\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Get Windows Server out of Stuck Update State&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[8,197],"tags":[328,327,221],"class_list":["post-1077","post","type-post","status-publish","format-standard","hentry","category-server-administration","category-windows","tag-command","tag-updates","tag-wsus"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/1077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=1077"}],"version-history":[{"count":3,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/1077\/revisions"}],"predecessor-version":[{"id":1080,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/1077\/revisions\/1080"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=1077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=1077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=1077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}