{"id":3418,"date":"2015-12-16T23:35:30","date_gmt":"2015-12-16T22:35:30","guid":{"rendered":"http:\/\/michlstechblog.info\/blog\/?p=3418"},"modified":"2021-07-27T14:59:47","modified_gmt":"2021-07-27T12:59:47","slug":"windows-10-trigger-detecting-updates-from-command-line","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/windows-10-trigger-detecting-updates-from-command-line\/","title":{"rendered":"Windows 10: Trigger detecting updates from command line"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_3418 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_3418')){$('.twoclick_social_bookmarks_post_3418').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Windows%2010%3A%20Trigger%20detecting%20updates%20from%20command%20line\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Asince%20Windows%2010%20the%20command%20wuauclt%20%2Fdetectnow%20does%20not%20work%20anymore.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/windows-10-trigger-detecting-updates-from-command-line\\\/\",\"post_id\":3418,\"post_title_referrer_track\":\"Windows+10%3A+Trigger+detecting+updates+from+command+line\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>since Windows 10 the command wuauclt \/detectnow does not work anymore.<br \/>\n<!--more--><\/p>\n<p>You can simply use the Comject Object <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa387287%28v=vs.85%29.aspx\" title=\"WUA Api\" target=\"_blank\" rel=\"noopener\">Microsoft.Update.AutoUpdate<\/a> within powershell (in evelated\/administrator mode) to trigger Windows Update for detecting new updates.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n(new-object -Comobject Microsoft.Update.AutoUpdate).detectnow()\r\n<\/pre>\n<p>To Install all downloaded Updates and restart the computer if requiered:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n$oInstaller=(New-Object -ComObject Microsoft.Update.Session).CreateUpdateInstaller()\r\n$aUpdates=New-Object -ComObject Microsoft.Update.UpdateColl\r\n((New-Object -ComObject Microsoft.Update.Session).CreateupdateSearcher().Search(&quot;IsAssigned=1 and IsHidden=0 and IsInstalled=0 and Type='Software'&quot;)).Updates|%{\r\n\tif(!$_.EulaAccepted){$_.EulaAccepted=$true}\r\n\t&#x5B;void]$aUpdates.Add($_)\r\n}\r\n$oInstaller.ForceQuiet=$true\r\n$oInstaller.Updates=$aUpdates\r\nif($oInstaller.Updates.count -ge 1){\r\n  write-host &quot;Installing &quot; $oInstaller.Updates.count &quot;Updates&quot;\r\n  if($oInstaller.Install().RebootRequired){Restart-Computer}\r\n} else {\r\n  write-host &quot;No updates detected&quot;\r\n}\r\n<\/pre>\n<p>Or use the <a href=\"https:\/\/gallery.technet.microsoft.com\/scriptcenter\/2d191bcd-3308-4edd-9de2-88dff796b0bc\" title=\"Windows Update Powersell Module\" target=\"_blank\" rel=\"noopener\">Windows Update Powershell Module<\/a> which provides a set of command-lets for handling windows updates.<\/p>\n<p>Newer Version of Windows 10 uses the <strong>usoclient <\/strong>command line utility. There are 4 options<br \/>\n<code><br \/>\nusoclient StartScan<br \/>\nusoclient StartDownload<br \/>\nusoclient StartInstall<br \/>\nusoclient RestartDevice<br \/>\n<\/code><br \/>\nMichael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, since Windows 10 the command wuauclt \/detectnow does not work anymore.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[788,119,133,787,390,1602,783,789,790],"class_list":["post-3418","post","type-post","status-publish","format-standard","hentry","category-windowsknowhow","category-windowsscripts","tag-detecting","tag-install","tag-powershell","tag-start","tag-trigger","tag-usoclient","tag-windows-10","tag-windows-updates","tag-wuauclt-detectnow"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/3418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=3418"}],"version-history":[{"count":11,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/3418\/revisions"}],"predecessor-version":[{"id":7745,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/3418\/revisions\/7745"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=3418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=3418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=3418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}