Upgrading from Windows 7/8 to Windows 10 via SMA script

 

UPDATE: I have changed Method 2 around to do just all .bat file since they seem to work more reliably (big thanks to my mate DaveH who helped on that). I may do some more testing to try and use the Launch a Program steps since you can use our Kace variables that way, and those directories get auto-cleaned up, but that could actually cause some problems with this, depending on when the agent decides it needs to clean up that directory. 

I think have another cleanup script would suffice for later; you could use a Smart Label to target newly upgraded windows 10 machines, then have a script delete the C:\windows 10 upgrade folder. 

 FYI 

SMA = Systems Management Appliance A.K.A K1000

SDA = Systems Deployment Appliance A.K.A K2000


Overall time to complete upgrade from start to finish: 30-45 minutes

ENVIRONMENT: VMware workstation running on a windows 10 M3800 laptop with 16GB RAM and SSD drives. 

 

Introduction

Since we have documentation on upgrading in place or clean install to Windows 10 using the SDA:

http://www.itninja.com/blog/view/upgrading-to-windows-10

 

I thought I would write up something specific on upgrading using the SMA in a script. 

 

There are 3 methods I show below. They first two do the same thing, just different in the approach in how we handle where the Windows 10 install files and where they are running from. Method 3 leverages the SMA entirely without the need for Samba access, so this could even be done over the web if needed, or replicated to your replication sites. 

 

Method 1: Run from network share does everything from a .bat file, and launches the upgrade directly from a UNC path. 

 

Method 2: Copy to/run from client will show copying the files down to the client first, then executing the upgrade. 

 

*NEW* Method 3: Run as a Managed Install does everything from the SMA directly without the need for a file share on your network. You will still need to be able to upload your Win10 install files via the Clientdrop share on the SMA since the files are too big for the web interface

 

Prerequisites

1.       Must have the appropriate media/ISO for Windows 10

a.       Like for like only. Example: Win7 Pro to Win10 Pro. Can’t do Win7 Home to Win10 Enterprise.

2.       I wrote this with the understanding you have a very basic knowledge of how our scripting module works. If you’d like a primer to this, please review some of our scripting tutorial video:

a.       https://www.youtube.com/watch?v=qG7Y-1rW9KE

 

Here is where the magic happens in this one .bat file example (you would run this from the root of the Windows 10 ISO directory:



 

setup.exe /auto upgrade /installfrom sources\install.wim /dynamicupdate disable

 



Basically we launch setup.exe with some switches from a network share, and the path to where the install.wim is.

 

For your script, you will need to change the server IP Address or name to yours, and the share path.

 

Link to list of switches you can use:

http://winaero.com/blog/windows-10-setup-exe-command-line-switches/

 

 

Method 1

1.       Create a new Online Kscript

2.       Create a task and add the following steps

3.       Verify a registry value is exactly…

3.1.    Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

3.2.    Name: ProductName

3.3.    Equal To: Windows 10 Enterprise

3.3.1. NOTE: Change this value to which ever version you are upgrading to

4.       On Success:

4.1.    Log message

4.1.1. Status: Windows 10 already installed

5.       Remediation:

5.1.    Run a batch file

5.1.1. Batch File: \\10.0.0.122\win10_upgrade\setup.exe /auto upgrade /installfrom \\10.0.0.122\win10_upgrade\sources\install.wim /dynamicupdate disable

 

Method 2

 

Prerequisite:

  1. Put the contents of you Windows 10 ISO files on a share.

    1.  In this example, i put my files on \\10.0.0.122\win10_upgrade\

 Step 5.1.1 shows how to do the robocopy part. Just explaining what it's doing; we're making a directory on the root of C:\ called win10_upgrade. You don't have to put it there, you could put it wherever really. 



Steps

1.      1.       Create a new Online Kscript

2.       Create a task and add the following steps

3.       Verify a registry value is exactly…

3.1.    Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

3.2.    Name: ProductName

3.3.    Equal To: Windows 10 Enterprise

3.3.1. NOTE: Change this value to which ever version you are upgrading to

4.       On Success:

4.1.    Log message

4.1.1. Status: Windows 10 already installed

5.       Remediation:

5.1.    Run a batch file

5.1.1. Batch file:  md c:\Windows10_media

robocopy /MIR \\10.0.0.122\win10_upgrade\ c:\windows10_media

5.2.    Run a batch file

       5.2.1 Batch file: cd c:\windows10_media\

setup.exe /auto upgrade /installfrom c:\windows10_media\sources\install.wim /dynamicupdate disable



Method 3


Step 1 – Upload your Windows 10 .zip file

 

1.    Unpack the contents of your Windows 10 ISO into a folder on your workstation.

2.    Zip all of those files up.

3.    Copy the .zip file to your clientdrop share on your SMA

4.    Login to your SMA admin interface

5.    Click Inventory > Software Catalog

6.    Search for the version of Windows 10

a.    In this example, I’m using Windows 10 Enterprise

7.    In the Windows 10 software catalog record, locate the exact version you are upgrading to

a.    TIP: To make sure I was using the exact version, I used the same ISO to install a fresh copy of Windows onto a VM, then installed the SMA agent and inventoried it to verify the version was correct

8.    Click the blue plus icon next to the desired version

9.    In the Associate a File dialog box, select the Choose file from Samba share radio button

10.  Select the .zip file from the drop down box

11.  Click Save

 

Step 2 – Create your Managed Installation

 

12.  Click Distribution > Choose Action > New

13.  Enter a name for your Managed Install

a.    Example: Windows 10 Enterprise Upgrade

14.  Select the Cataloged Software radio button

15.  Select your Windows 10 record from the Cataloged Software drop down

16.  In the Associated File box, select the .zip file you uploaded and associated

17.  In Installation Options, select Override Default Installation

18.  Enter the following command line:

a.    setup.exe /auto upgrade /installfrom C:\programdata\dell\kace\downloads\139\sources\install.wim
/dynamicupdate disable

b.    Change ‘139’ to the software ID of the .zip you uploaded. To obtain this, go back to the Software Catalog item for Windows 10, and hover your mouse or inspect the hyperlink for the .zip file under the Associated Files section. Example: https://k1000.mydomain.com/packages/139/en_windows_10_enterprise_version_1703_updated_march_2017_x64_dvd_10189290.zip

19.  Target the machines you desire

20.  Click Save

And that's pretty much it. Enjoy! Leave any questions/comments below