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
  • 451 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 2 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 about 2 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 about 2 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 24 days 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 7 days ago

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

    Gravatar for Brandon Dube
    Brandon Dube about 14 hours 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 about 13 hours ago

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

    Gravatar for Edna Rainey
    Edna Rainey about 13 hours ago

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

    Gravatar for Chris Higham
    Chris Higham about 13 hours 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 about 13 hours 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.