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


 NOTE: Testing some final pieces of this, so if you get errors, let me know in the comments

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. 


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 K2000:

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

 

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

 

There is 2 methods I show below. They both do the same thing, just different in the approach in how we handle where the Windows 10 install files and where they are ran from

 

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. 



 

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



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