Windows 10 2018

Windows 10 update to 1903

Windows 10 update to 1903

Description

This will perform an entire Operating System upgrade, it is recommended to perform a backup and/or system restore point before proceeding with the OS upgrade.
The workstation will be restarted as part of the procedure.
The whole process takes between 45 minutes and 2 hours until the workstation can be used again.
It is recommended to update Rapid Technology driver before you run this script.
It is also recommended to have at least 20 GB free on the endpoint before running the procedure, otherwise the procedure could fail without giving any error message.
This listing does not require to upload any files. It will download a file directly form Microsoft to perform the upgrade.
It will give them 30 minutes before restarting automatically, if it doesn't get any respond it will reboot it after 30 minutes automatically. It will also delete the tool after 3 hours.

Reza Gholami
RGholami@CBEsolutions.com
8/20/2019

Developer
  • Name: Reza Gholami
  • Company: CBE Office Solutions
  • Website:
  • Contact Developer
  • Summary
  • Windows 10 update to 1903
  • 641 Downloads
  • Version: 1.1
  • Released on August 22nd, 2019
  • Reviews
    Gravatar for Eric Peacock
    by Eric Peacock on October 17th, 2019

    This is fantastic! We will save SO much time completing Windows 7 to 10 migration now. I've tested on several Win7 machines and on Win10 v18xx machines and it's worked great. The best part is, in coming years all you'll need to do is update the Microsoft download link to easily stay on your preferred version of Windows 10. Thanks for publishing this.

    Gravatar for Brian Gottshall
    by Brian Gottshall on October 1st, 2019

    Just an FYI for this script, if you push this out to machines that are running Windows 7, it will upgrade the machine to Windows 10, 1903. Found this out the hard way.

    Discussion
    Gravatar for Oscar Hernandez
    Oscar Hernandez 5 months ago

    I've ran this procedure on two separate servers and the procedure remains pending. Has this worked for anyone else? 

    Gravatar for Reza Gholami
    Reza Gholami 5 months ago

    Oscar,

    1903 is just for Windows 10.

    I tested it on more than 30 machines with different versions from 1511 to 1809 before I publish it and all worked fine.

    Gravatar for Oscar Hernandez
    Oscar Hernandez 5 months ago

    Sorry Reza, when I meant two different servers, I meant from two differnet VSA servers on separate windows 10 endpoints. It fails on the command line Step 4. I apologize for confusion. 

    Gravatar for Oscar Hernandez
    Oscar Hernandez 5 months ago

    It seems to have worked on one of my Window's 10 machines. I am troubleshooting the other one it failed on, timed out command line. 


    Gravatar for Reza Gholami
    Reza Gholami 5 months ago

    No problem at all Oscar,

    I'm glad you've tried it. It should work based on my test on different machines with different user permissions.

    Please let us know how it goes on the other one. Reboot it and then try it again. LOL

    Thank you

    Gravatar for Reza Gholami
    Reza Gholami 5 months ago

    Oscar,

    Please update Rapid technology driver/software on those computers and then try to run the script to see how it goes.

    Thanks

    Gravatar for Datalyst
    Datalyst 5 months ago

    Please add a systems restore point into the script

    ExecuteShellCommand, as system in 64 bit

    wmic /namespace:\\root\default path SystemRestore call CreateRestorePoint "Pre-Win 10 1903 Upgrade", 100, 0

    Gravatar for Edna Rainey
    Edna Rainey 5 months ago

    System Restore, yes! I tried this on a machine running 1803 and one running 1809. It upgraded both without issue.

    Gravatar for Datalyst
    Datalyst 5 months ago

    Can we also add a self checking disk space limitation PS command?  If there is disk space, great continue on, if not abort the script

     Get-WmiObject win32_logicaldisk -Filter "Drivetype=3" | %{

        if ($_.FreeSpace/1GB -lt 20){

     write-host "Low disk space, aborting windows 10 1903 upgrade"

            }

           else

    {

     write-host "Enough disk space, continuing with Windows 10 1903 upgrade "

     }

     }


    Gravatar for Datalyst
    Datalyst 5 months ago

    Trying to replace "Drivetype=3 with "deviceid='$($os.systemdrive)'" as some machines may have more than one local drive and the OS drive may NOT be the "C" drive but cannot get that to work correctly yet.

    Also, Should we also have as step 1 in the script a validation check that the OS is indeed Windows 10 we are upgrading?

    Gravatar for Datalyst
    Datalyst 5 months ago

    Resolved both issues.

    1. Run on windows 10 only.  Set each script line to only run on Windows 10

    2. Disk space.  Added a get variable for "root\cimv2:Win32_LogicalDisk.FreeSpace"

    3. used IF EVAL to calculate free disk space ((#FreeSpace#/1024)/1024)/1024 is greater than or equal to 40  (double what MS states)

    4. If there is space, perform the update

    5. No space, abort

    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">
    <Procedure name="Windows 10 update to 1903" treePres="3" id="1716255236" folderId="980695641311208" treeFullPath="DTL Testing">
    <Body description="It will download Windows 10 update 1903 tool and updates the Windows and at the end notify user to reboot the computer and give them 30 minutes, if it doesn't get any respond it will reboot it after 30 minutes automatically . ">
    <Statement name="GetVariable" continueOnFail="false" osType="10">
    <Parameter xsi:type="EnumParameter" name="VariableType" value="WMIProperty"/>
    <Parameter xsi:type="StringParameter" name="SourceContent" value="root\cimv2:Win32_LogicalDisk.FreeSpace"/>
    <Parameter xsi:type="StringParameter" name="VariableName" value="FreeSpace"/>
    </Statement>
    <Statement name="GetVariable" continueOnFail="false" osType="10">
    <Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue"/>
    <Parameter xsi:type="StringParameter" name="SourceContent" value="#vAgentconfiguration.AgentTempDir#\Windows10-1903"/>
    <Parameter xsi:type="StringParameter" name="VariableName" value="win"/>
    </Statement>
    <If description="">
    <Condition name="EvaluateExpression">
    <Parameter xsi:type="StringParameter" name="ExpressionText" value="((#FreeSpace#/1024)/1024)/1024"/>
    <Parameter xsi:type="EnumParameter" name="Condition" value="GreaterThanOrEquals"/>
    <Parameter xsi:type="StringParameter" name="Value" value="40"/>
    </Condition>
    <Then>
    <Statement name="WriteScriptLogEntry" continueOnFail="false" osType="10">
    <Parameter xsi:type="StringParameter" name="Comment" value="Enough disk space to Upgrade Windows 10 1903"/>
    </Statement>
    <Statement name="ExecuteShellCommand" continueOnFail="false" osType="10">
    <Parameter xsi:type="StringParameter" name="Command" value="wmic /namespace:\\root\default path SystemRestore call CreateRestorePoint "Pre-Win 10 1903 Upgrade", 100, 0"/>
    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System"/>
    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="True"/>
    </Statement>
    <Statement name="ExecuteShellCommand" continueOnFail="false" osType="10">
    <Parameter xsi:type="StringParameter" name="Command" value="mkdir #win#"/>
    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System"/>
    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False"/>
    </Statement>
    <Statement name="GetURL" continueOnFail="false" osType="10">
    <Parameter xsi:type="StringParameter" name="URL" value="https://go.microsoft.com/fwlink/?LinkID=799445"/>
    <Parameter xsi:type="StringParameter" name="ResponseFileName" value="#win#\Windows10Upgrade9252.exe"/>
    <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True"/>
    </Statement>
    <Statement name="ExecuteShellCommand" continueOnFail="false" osType="10">
    <Parameter xsi:type="StringParameter" name="Command" value="#win#\Windows10Upgrade9252.exe /quietinstall /skipeula /auto upgrade /copylogs #win\logs"/>
    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System"/>
    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False"/>
    </Statement>
    <Statement name="PauseScript" continueOnFail="false" osType="10">
    <Parameter xsi:type="IntegerParameter" name="Seconds" value="10800"/>
    </Statement>
    <Statement name="Delete Directory" continueOnFail="false" osType="10">
    <Parameter xsi:type="StringParameter" name="Parameter1" value="#win#"/>
    <Parameter xsi:type="StringParameter" name="Parameter2" value="true"/>
    </Statement>
    </Then>
    <Else>
    <Statement name="WriteScriptLogEntry" continueOnFail="false" osType="10">
    <Parameter xsi:type="StringParameter" name="Comment" value="Not enough disk space to upgrade to Windows 10"/>
    </Statement>
    </Else>
    </If>
    </Body>
    </Procedure>
    </ScriptExport>


    Gravatar for Edna Rainey
    Edna Rainey 5 months ago

    I tried this on another Win 10 machine and it did not execute. Could this be because it was set at "Semi-Annual Channel (Targeted)? 

    Gravatar for Edna Rainey
    Edna Rainey 5 months ago

    I tried this on another Win 10 machine and it did not execute. Could this be because it was set at "Semi-Annual Channel (Targeted)? 

    Gravatar for Bud Manz
    Bud Manz 5 months ago

    Hi Edna,

    Did you, by chance, check to make sure there was no restart pending (like for other updates)?

    HTH,
    Bud Manz

    Gravatar for michael hardee
    michael hardee 5 months ago

    Am I crazy or is this missing the "give the user 30 minutes to reboot" feature it talks about in the description?  I see it pauses for 3 hours before cleaning up after itself, but the reboot portion doesn't seem to actually be happening

    Gravatar for Jonathon Nash
    Jonathon Nash 5 months ago

    Nope, it definitely just instant restarts the computer without notice. The 30 minutes is built into the Windows Feature updater IF it's not set to install quietly. I personally don't care, I run the procedure at night.

    Gravatar for Marc Punte
    Marc Punte 4 months ago

    I've tried the procedure with, and without the quiet parameter, but it always reboots the machine without asking the user if it's ok...

    any ideas how to fix this.?

    Gravatar for Reza Gholami
    Reza Gholami 4 months ago

    It will notify user with and without quiet parameter, actually quiet parameter is for the process, that means user won't be able to see the installation process of updating but they will notify for the reboot anyway which is part of the windows feature updater. 

    Gravatar for Jon Harwood
    Jon Harwood 4 months ago

    Reza - It doesn't notify the user and just reboots, I have run it on my own test machine and there was no warning at all.

    Gravatar for Reza Gholami
    Reza Gholami 4 months ago

    Are you sure? You didn't miss it? because it reboots automatically after 30 minutes.

    Now questions are, did it update it to 1903? Did it even reboot at all after you ran the script?

    Gravatar for Jon Harwood
    Jon Harwood 4 months ago

    Hi Reza, perfectly sure and yes it did update. We have also had users tell us the same thing. 

    Can you set it to prompt the user to reboot rather than forcing a reboot after 30 minutes which is what happens if you run it from MS.

    Gravatar for Jonathon Nash
    Jonathon Nash 4 months ago

    I'm not "Jon Harwood" and I can confirm it does successfully update to 1903 and abruptly restarts the computer without giving the users any warning.

    Gravatar for Reza Gholami
    Reza Gholami 4 months ago

    Hi Jon and Jonathon, It's weird because that reboot part is built in to that updater! and it should notify user with 30 minutes count down. 

    There is no immediately reboot in the script.  

    Gravatar for Jonathon Nash
    Jonathon Nash 4 months ago

    I'm not sure if there is a fix or not. If the process is not running as the user, the restart warning prompt doesn't come up.

    Gravatar for Reza Gholami
    Reza Gholami 4 months ago

    There is no restart or warning if it doesn't run the updater or if it runs but fails for any reason. 


    Gravatar for Aaron Trandem
    Aaron Trandem 4 months ago

    I'm finding that the update auto reboots and the 30 minutes of wait time to reboot isn't happening. Overall the installation takes about an hour but the script doesn't fully complete for another 2 or more after, skipping the reboot and then it will eventually delete the folder and objects inside it. Is anyone else getting similar results?

    Gravatar for Brian Gottshall
    Brian Gottshall 4 months ago

    Just an FYI, if you run this on a Windows 7 machine, it upgrades it to Windows 10, 1903...

    Gravatar for Jani Neuvonen
    Jani Neuvonen 3 months ago

    I've been using /NoReboot switch so that it does not force reboot but this has stopped working recently so I think MS updated the Update Assistant and removed that option for some reason. Here's all the switches I use: /QuietInstall /SkipEULA /NoReboot /UninstallUponUpgrade, the last one uninstalls the Update Assistant from the machine after the upgrade is done.

    Gravatar for Tabrez Goilkar
    Tabrez Goilkar 2 months ago

    can we have option upgrade from share folder instead of Microsoft folder

    Gravatar for Brandon Dube
    Brandon Dube 2 months ago

    Has anyone tried this to update to 1909 instead of 1903? it looks to me like the path to download the upgrade assistant now points to the 1909 version (probably done by ms).

    Gravatar for Edna Rainey
    Edna Rainey 2 months ago

    One of our engineers ran this script and it upgraded to 1909.

    Gravatar for Edna Rainey
    Edna Rainey 2 months ago

    Yes, we checked 5 more machines and this script is upgrading to 1909.

    Gravatar for Chris Higham
    Chris Higham 2 months ago

    Guys and Gals,

    First, i'm not the author of this script althought we use a similar script ourselves-- the script is pulling what is essentially the MS Update Assistant, which at any given time will upgrade to the latest release, which as of last week is 1909.   

    There is nothing that i'm aware of to 'fix' in the script that would allow this to act differently as the script relies on the upgrade tool and the upgrade tool will always pull the latest build. 


    That being said i'm not sure that i've seen any real issues yet with 1909 that would cause me to worry about it over 1903.

    Gravatar for Eric Peacock
    Eric Peacock 2 months ago

    The 1909 update is going to be entirely on Microsoft's end. This script just downloads and runs the updater from Microsoft directly. If you could find a link to the 1903 only updater, you could change the script download URL to that.

    Gravatar for Tabrez Goilkar
    Tabrez Goilkar 14 days ago

    Failed THEN in step 3 (Line 3)


    i am getting above error any suggestions?

    Gravatar for Tabrez Goilkar
    Tabrez Goilkar 14 days ago

    Failed THEN in step 3 (Line 3)


    i am getting above error any suggestions?

    Gravatar for Eric Peacock
    Eric Peacock 14 days ago

    @TabrezGoilkar

    Step 3 is downloading the file. There are many things that could be causing this to fail, such as network issues, disk issues, etc. The first thing I'd try is manually opening the URL in the script on a computer that is failing in step 3 and see if it does the download manually.

    Gravatar for Philip Woods
    Philip Woods 14 days ago

    Is anyone having issues getting the script to run when removing the /quietinstall switch?  With the switch on the script executes flawlessly, however when removed I constantly get a Failed THEN in step 4.

    Gravatar for Gregory Wells
    Gregory Wells 14 days ago

    Do you not want a quiet install?

    Gravatar for Philip Woods
    Philip Woods 14 days ago

    Unfortunately it is not feasible in my environment.  The quiet install does a forced reboot and I have 24/7 endpoints so there is no "off hours" schedule to do an upgrade.

    Gravatar for Matt
    Matt 14 days ago

    The forced reboot is a huge issue with installing feature updates this way. Users will get a popup and have about 30 seconds to save anything. I have been battling that since we started using this approach. 

    Gravatar for Reza Gholami
    Reza Gholami 14 days ago

    Hi Guys,

    Just FYI: Sometimes the failure might be because of some drivers such as "Rapid Storage Technology" driver which you need to update it, or you have some software that are not compatible with Windows 10 such as "Windows Security Essential" which you need to remove it before run this script.

    Thanks

    Gravatar for Adam
    Adam 11 days ago

    @Matt I've tried both /noreboot and /norestart to suppress an automatic reboot, but haven't had the time to dig into it much. Have you tested either switch to see if it prevent a reboot after the upgrade completes?

    If you have 24/7 endpoints how do you do any updates? Major version releases can take an hour to reboot and come back up, so even if it was user-initiated it would still be down for that hour after.

    Gravatar for Matt
    Matt 11 days ago

    @Adam we use the Software Management for security and important patching. We do not have many 24/7 endpoints so these updates are not the issue. From Kaseya, the /norestart and /noreboot do not work. I have not tested if those flags work outside of Kaseya agent procedures. The agent procedure runs as system so the logged on user does not see the reboot prompt because the process is not running as user. At least that is what I think is happening. 

    Gravatar for Adam
    Adam 11 days ago

    @Matt ah okay.

    I just tested by scheduling from Kaseya with /noreboot and /norestart both set - after 15 minutes it hadn't rebooted but the Windows10UpgraderApp.exe process was still running, so it's unclear.

    I've moved most of the workflow to powershell at this point. I monitor the install log C:\Windows10Upgrade\upgrader_default.log to get an approximation of the status.  Looking at the log I see this line before it stops doing anything -

    2020-01-16 23:54:47.908, Info      Calling js function to transform state WaitForRestartWindows: javascript:updateControls(220, "")

    feasibly you could set up powershell to watch for that line and then kill the upgraderapp and handle reboots manually from there.  I tested this manually and it upgraded the machine as expected.

    Gravatar for Jason Stroud
    Jason Stroud 11 days ago

    For those commenting about switches not working I wanted to provide some clarification. These are not switches that are "Kaseya switches"; nor are they switches for Windows OS installation media. This is the Windows Update Assistant. Microsoft has no published "switches" I can find for it. We've experimented with this installer for some time and the best option we found was that /warnreboot does function. It however still reboots with or without user interaction to the warning message. We therefore schedule an en masse day and time for all customer PCs or for a one off basis with each user confirm a time where a forced reboot will not be problematic. Not ideal but considering Microsoft has gone out of their way to not make this easy for MSPs, something is better than nothing.

    In summary, you can definitely have Kaseya procedures that will honor the /noreboot or /norestart switch. But this is specific to the installer you are using. And in this case the Windows Update Assistant installer is what this procedure is applying switches to and not the actual OS installer. This isn't a scripting issue. It's an issue that the developer didn't account for.

    ¯\_(ツ)_/¯

    Gravatar for Danial
    Danial 11 days ago

    I just running this with /quiteinstall /skipeula /auto upgrade 

    And mine doesn't even reboot so in my case it works fine.

    Gravatar for Matt
    Matt 11 days ago

    @Jason - do you know what the time frame for reboot is with the /warnreboot? If it is > 30 minutes or allows the end users to postpone, that would be the magic I am looking for. Sure would be nice if the standard windows switches would work for these feature updates.  

    Gravatar for Matt
    Matt 11 days ago

    @Danial - I tested the /quietinstall /skipeula /auto upgrade and the computer gave a quick (maybe 5 second warning) and rebooted. Are you using this with the Windows10Upgrade9252.exe?

    Gravatar for Adam
    Adam 11 days ago

    That executable is always used for the current release, but it does look like it's waiting now that we're on 1909. It was definitely more aggressive about rebooting under 1903.  Matt if you haven't tried it since 1909 went general release, maybe try again?