We are trying to automate Feature upgrade process from Windows 10 1607 to 1703. WSUS is used to distribute the update package.

When upgrade is installed ( using gpo or comobject Microsoft.Update.Session), the status in Windows Updates Settings is 'A restart is required to finish installing the follwing updates: Feature update to Windows 10 enterprise,version 1703" Below the message I can see 'Restart Now' button.

Since I am trying to automate the process, I will need to restart the computer by using non gui method, i.e. running restart-computer, wmi, or some other way . When computer reboots, the update is not being installed. I have also tried 'usoClient RestartDevice' without success.

The upgrade only happens when I use Restart Now button. How can I force Windows to do the actual install during reboot without using Windows Updates Settings GUI? Surely 'Restart' is a restart, whatever way it is executed?

  • 1
    Cross site duplicate of serverfault.com/questions/395417/… ; Try wuauclt.exe /detectnow /updatenow; before restart command - this may help! – Am_I_Helpful Nov 24 '17 at 17:00
  • The button isn't actually "Restart", it corresponds to "Update and Restart" in the Start menu. – grawity Nov 25 '17 at 11:26
  • Thank you Am_I_Helpful. Did you know that Wuaclt has been replaced by usoclient in Windows 10 ? blogs.technet.microsoft.com/yongrhee/2017/11/09/… .The serverfault issue you refer to is for updates , not feature upgrade. I don't see problems with updates - they are applied following reboot as expected following required reboot. It is feature upgrade that I have issue with. – Sergei Nov 25 '17 at 20:35
  • Hi grawity, thank you for commenting. I am aware about Update and restart button but my question is about automating about entire process. I can't go around 2000+ computers and click the button. – Sergei Nov 25 '17 at 20:36
  • I can see similiar request with no answer here superuser.com/questions/1262461/… – Sergei Nov 25 '17 at 20:41

This works for me doing unattended upgrades to 1709 via PowerShell / ComObject Microsoft.Update.Installer. I've omitted the download code since it's not relevant for this question.

if ($DownloadComplete) {

    Write-Output "Staging the upgrade.."
    $Installer = New-Object -ComObject Microsoft.Update.Installer
    $Installer.Updates = $Collection
    $InstallResult = $Installer.Install()
}            

if ($InstallResult.HResult -eq 0 -and $InstallResult.ResultCode -eq 2 -and $InstallResult.RebootRequired) {

    Write-Output "Staging complete. Finalising the upgrade.."
    Start-Process -FilePath 'C:\$WINDOWS.~BT\Sources\SetupHost.exe' -WorkingDirectory 'C:\$WINDOWS.~BT\Sources' -ArgumentList '/finalize /update'
}

I have been dealing with this same issue. There seems to be a huge lack of knowledge when it comes to trying to automate these feature upgrades. My WSUS server is pushing out the feature upgrades, but I have many computers that never finish the restart process needed to actually install it.

A normal restart does not initiate the install, only clicking restart from the Windows Update control panel, or clicking update and restart/update and shutdown from the start menu. Neither of which I can find a command line/powershell equivalent for.

The ONLY thing I have comes across is a someone mentioning this very issue and saying that they used the following command to "finalize" the install.

C:\$WINDOWS.~BT\Sources\SetupHost.Exe /Finalize /Update /InstallFile "C:\$WINDOWS.~BT\Sources\Install.esd"

So far, I have been unable to get it to work, but maybe someone else will have some luck and help the rest of us get it working as well.

  • I'm sorry to hear you're experiencing issues, but this area is reserved for answers, not comments or "me too" posts. If you have your own question that differs from this, please post it using the Ask Question button at the top of the page. – music2myear Jan 5 at 18:42
  • I understand it is for answers hence why I supplied the code snippet I did. That the only answer I have been able to find as well and hoped by submitting it that someone might be able to use it to at least get closer to an answer since no one seems to have a full answer yet. – Seventoad Jan 6 at 1:56

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.