Upgrading from Windows
7/8 to Windows 10 via SMA script
UPDATE: 5-21-2018: There is a new KB that covers this same topic that is available on the Quest support site:
Very well done by one of their developers.
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
This also works for the Windows 10 Features Updates, like the Windows 10 Fall Creators Update as well
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.
Windows 10 Readiness Report
After talking with some folks and playing around with this upgrade more, I realized that our built in 'Windows 8 Readiness Report' was pretty close to what you would need for a Windows 10 version, so I modified it and thought I would share
TITLE | Windows 10 Readiness Assessment |
DESCRIPTION | Identify all devices with hardware capable of installing Windows 10: at least 1Gb RAM (32-bit) or 2Gb RAM (64-bit), 10Gb free disk space (32-bit) or 20Gb free disk space (64-bit), and 1Ghz processor. Devices are grouped by Can be Upgraded, Install Only, or not able to run Windows 10. |
BREAK ON | UPGRADABLE |
QUERY | SELECT * FROM ( SELECT MACHINE.ID, MACHINE.NAME AS NAME, OS_NAME, OS_ARCH AS ARCH, IF(OS_NAME LIKE '%Vista%' OR OS_NAME LIKE '%7%' OR OS_NAME LIKE '%Windows 8%' OR OS_NAME NOT LIKE 'Server', IF(OS_NAME LIKE '%RTM%' OR OS_NAME LIKE '%Starter%' OR OS_NAME NOT LIKE '%Server%' ,'Install Only', 'Can be Upgraded'),'Install Only' ) AS UPGRADABLE, PROCESSORS, RAM_TOTAL, SUM(MACHINE_DISKS.DISK_SIZE) AS DISK_SIZE, MACHINE_DISKS.DISK_FREE AS DISK_FREE, VIDEO_CONTROLLERS AS VIDEO FROM MACHINE LEFT JOIN MACHINE_DISKS ON (MACHINE_DISKS.ID = MACHINE.ID) LEFT JOIN OPERATING_SYSTEMS OS ON (OS.ID = MACHINE.OS_ID) WHERE OS.FAMILY = 'windows' AND OS.NAME NOT LIKE '%Server%' AND NOT (OS_MAJOR = '10' AND OS_MINOR = '0') -- Win 10 AND (1 IN ( SELECT 1 FROM MACHINE_DISKS WHERE MACHINE_DISKS.ID = MACHINE.ID AND IF(MACHINE.OS_ARCH LIKE '%x86%',MACHINE_DISKS.DISK_FREE >= '16',MACHINE_DISKS.DISK_FREE >= '20') ) ) AND IF(MACHINE.OS_ARCH LIKE '%x86%', RAM_TOTAL >= '1000',RAM_TOTAL >= '2000') AND PROCESSORS NOT LIKE '%Mhz%' GROUP BY MACHINE.ID ) AS PASSED UNION ALL SELECT * FROM ( SELECT MACHINE.ID, MACHINE.NAME AS NAME, OS_NAME, OS_ARCH AS ARCH, 'Not Enough Disk' AS UPGRADABLE, PROCESSORS, RAM_TOTAL, DISK_SIZE AS DISK_SIZE, MACHINE_DISKS.DISK_FREE AS MACHINE_DISKS_DISK_FREE, VIDEO_CONTROLLERS AS VIDEO FROM MACHINE LEFT JOIN MACHINE_DISKS ON (MACHINE_DISKS.ID = MACHINE.ID) LEFT JOIN OPERATING_SYSTEMS OS ON (OS.ID = MACHINE.OS_ID) WHERE OS.FAMILY = 'windows' AND NOT (OS_MAJOR = '10' AND OS_MINOR = '0') -- Win 10 AND OS.NAME NOT LIKE '%Server%' AND (1 NOT IN ( SELECT 1 FROM MACHINE_DISKS WHERE MACHINE_DISKS.ID = MACHINE.ID AND IF(MACHINE.OS_ARCH LIKE '%x86%',MACHINE_DISKS.DISK_FREE >= '16',MACHINE_DISKS.DISK_FREE >= '20') ) ) GROUP BY MACHINE.ID ) AS DISK UNION ALL SELECT * FROM ( SELECT MACHINE.ID, MACHINE.NAME AS NAME, OS_NAME, OS_ARCH AS ARCH, 'Not enough Memory' AS UPGRADABLE, PROCESSORS, RAM_TOTAL, MACHINE_DISKS.DISK_SIZE AS DISK_SIZE, DISK_FREE AS MACHINE_DISKS_DISK_FREE, VIDEO_CONTROLLERS AS VIDEO FROM MACHINE LEFT JOIN MACHINE_DISKS ON (MACHINE_DISKS.ID = MACHINE.ID) LEFT JOIN OPERATING_SYSTEMS OS ON (OS.ID = MACHINE.OS_ID) WHERE OS.FAMILY = 'windows' AND NOT (OS_MAJOR = '10' AND OS_MINOR = '0') -- Win 10 AND OS.NAME NOT LIKE '%Server%' AND IF(MACHINE.OS_ARCH LIKE '%x86%', RAM_TOTAL < '1000',RAM_TOTAL < '2000') GROUP BY MACHINE.ID ) AS NOT_ENOUGH_MEMORY UNION ALL SELECT * FROM ( SELECT MACHINE.ID, MACHINE.NAME AS NAME, OS_NAME, OS_ARCH AS ARCH, 'Not enough Processor Speed' AS UPGRADABLE, PROCESSORS, RAM_TOTAL, MACHINE_DISKS.DISK_SIZE AS DISK_SIZE, MACHINE_DISKS.DISK_FREE AS DISK_FREE, VIDEO_CONTROLLERS AS VIDEO FROM MACHINE LEFT JOIN MACHINE_DISKS ON (MACHINE_DISKS.ID = MACHINE.ID) LEFT JOIN OPERATING_SYSTEMS OS ON (OS.ID = MACHINE.OS_ID) WHERE OS.FAMILY = 'windows' AND NOT (OS_MAJOR = '10' AND OS_MINOR = '0') -- Win 10 AND OS.NAME NOT LIKE '%Server%' AND PROCESSORS LIKE '%Mhz%' GROUP BY MACHINE.ID ) AS PROCESSOR_TOO_SLOW UNION ALL SELECT * FROM ( SELECT MACHINE.ID, MACHINE.NAME AS NAME, OS_NAME, OS_ARCH AS ARCH, 'Not Required (Windows 10 Already Installed)' AS UPGRADABLE, PROCESSORS, RAM_TOTAL, MACHINE_DISKS.DISK_SIZE AS DISK_SIZE, MACHINE_DISKS.DISK_FREE AS DISK_FREE, VIDEO_CONTROLLERS AS VIDEO FROM MACHINE LEFT JOIN MACHINE_DISKS ON (MACHINE_DISKS.ID = MACHINE.ID) LEFT JOIN OPERATING_SYSTEMS OS ON (OS.ID = MACHINE.OS_ID) WHERE OS.FAMILY = 'windows' AND OS_MAJOR = '10' AND OS_MINOR = '0' -- Win 10 AND OS.NAME NOT LIKE '%Server%' GROUP BY MACHINE.ID ) AS ALREADY_WIN_10 ORDER BY UPGRADABLE, NAME |
QUERY:
Should look like this:
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.
(My Preferred) Method 1: 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 SMB share on the SMA since the files are too big for the web interface
Method 1: Run from network share does
everything from a .bat file, and launches the upgrade directly from a UNC
path.
Method 3: 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. Scripting 101 with Kace SMA and Windows 10 upgrade
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:
Converting .esd files to .wim
Shout out to WraithKnight80 who discovered this.
dism /Get-WimInfo /WimFile:install.esd
dism /export-image /SourceImageFile:install.esd /SourceIndex:1 /DestinationImageFile:install.wim /Compress:max /CheckIntegrity
https://community.spiceworks.com/how_to/125905-change-esd-to-wim
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 (preferred)
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.
4. Login to your SMA admin interface
5. Click Inventory > Software Catalog (NOTE: You can use the Legacy 'Software' library if you wish instead)
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\quest\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
Copy to and run from client
- Put the contents of you Windows
10 ISO files on a share.
- 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
Run from network share
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
And that's pretty much it. Enjoy! Leave any
questions/comments below
Firstly I got to see a few of your classes regarding the K1000 and Labels at Dell World 2015 and I enjoyed them and have used them, thank you!
My question is will this work with a custom WIM file created through WDS? I am about to undergo my first deployment and I am still learning my options but ideally I would like to update to a custom image with much of the Windows 10 default apps removed.
Would it pick up the current applications the user is running if I upgraded from 7? If so I would not need to preinstall anything in the 10 image.
Also if this is more of a Microsoft question please let me know.
Thank you! - cmurphy 8 years ago
http://www.itninja.com/blog/view/windows-10-deployment-re-adds-bloatware-tips-and-tricks-to-help-get-rid-of - SMal.tmcc 8 years ago
I haven't tested it yet, but i wouldn't see why it wouldn't. I haven't tested a bunch of differnt apps, but the basic ones (chrome, reader, etc) all seemed to work just fine after upgrading to 10.
I imagine some software will have updates it will need after upgrading to windows 10 - brucegoose03 8 years ago
On a separate note have you tested this with the user logged out?
Thanks - cmurphy 8 years ago
It would probably be better to specify the share permission more restricted, and have your script run with those credentials. - brucegoose03 8 years ago
Any thoughts would be appreciated but it is working as one batch file. - cmurphy 8 years ago
I wonder if this will work for an upgrade from Windows Server 2008 to Windows Server 2012?
Has anyone tried this? - Alexr254 8 years ago
"Run As Console Logged in user failed: No User logged in to console". I have also tried running the /quiet option on setup.exe that should suppress ux but do dice still fails with some error.
My server is Version: 6.4.120756
Agent Version: 6.4.522
Any help or pointers would be appreciated. Ideally I want to run this on around 50Win 7 systems to upgrade them all over night.
Thanks in advance. - jamturtle 8 years ago
"Allow run without a logged-in user" and that should fix that problem.
Let me know! - brucegoose03 8 years ago
I have manged to run this by making a few changes it may help others.
I have added the /quiet switch to setup.exe in the batch file. There is also an /unattend switch but I can not tested it.
This link has a complete list of switches for setup.exe
https://msdn.microsoft.com/en-us/windows/hardware/commercialize/manufacture/desktop/windows-setup-command-line-options
In the Remediation section where the batch file is. Make sure you tick "Wait for completion" and "Visible". I could not find documentation on what these boxes actually do so it was just trial and error. Clicking both worked.
Also if you are on a domain network you need to share win10 from a no passwd share. Bruce mentions everyone permission on his share which did not work on my network but it may on others. I could not get around this getting use rights problems when run as "Local System" and when run with Admin credential I always got "Run As Console Logged in user failed: No User logged in to console". I am not sure why this did not work for me, it may be the way the kbot runs not sure. I did test that an installed with admin creds in the kscript run fine when a user was logged in and that worked fine but for a silent install in the middle of the night with no users logged on this did not work. My work around was enable a "Public" share (no passwd or try an everyone permissions share) on a PC and copy the Win10 installation files, point the batch file to this share on the network and run the script as "Local System".
Bingo it worked.
Thanks again Bruce for your post.
Cheers - jamturtle 8 years ago
Also has anyone have any other suggestion to get drivers to work, I will have the support team push via script in k1000 windows 10, and would like to avoid manually having to install drivers afterwards.
This is the switch"/installDrivers <location>" settings I see from this link https://msdn.microsoft.com/en-us/windows/hardware/commercialize/manufacture/.
desktop/windows-setup-command-line-options
Adds .inf-style drivers to the new Windows 10 installation. The driver .inf can be in a folder within the specified location. The command will recurse through the specified location. Example:
Accepted parameters are a local file path or UNC network path to a folder that contains .inf files.
setup.exe /auto upgrade /installdrivers C:\Fabrikam\drivers /noreboot
This setting is new for Windows 10. - itadder 8 years ago
a) I created "Online Script " as per above post instructions .
b) It worked only one time after that nothing happen under running script status its showing running running but dont know whats going on back end.
c) Client Connectivity working fine. I tried with single host machine and used labels but no luck can you help me out .
Note : we are running with windows 7 pro 64 bit we want to upgrade windows 10 Pro .
Thanks in advance. - DeepakSumbria 8 years ago
I would try and run the command from a command prompt and see if there are any errors that pop up when running it that way. If it's just not running the script at all from teh Kace side, there could be a number of things causing it. Support might be able to help you identify why the script isn't running at all. They're limited on some aspects with getting specialized scripts to run, but somethign like the script just not running they should be able to help you with - brucegoose03 8 years ago
Trying to make use of the Powershell commands - "Get-AppXProvisionedPackage -online | Remove-AppxProvisionedPackage -online" in a script (which in itself works fine when manually "run as administrator")
But when scripted via K1000 its failing to run the script successfully, it doesnt seem to have the elevated privelages required for the commands.
Has anyone else going down the inplace upgrade route had any success in scripting the removal of metro apps via K1000? - rjonesdj 7 years ago
Try something like a .bat file that runs your PowerShell command:
powershell.exe -ExecutionPolicy Bypass -File "C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\190\MyPowerShellScript.ps1"
Change the '190' there to the ID of your script (look at the URL of what script your using and you'll see a number listed
Ex. https://k1000.domain.com/adminui/kbot.php?ID=118 - brucegoose03 7 years ago
So something like:
Dism /Mount-Image /ImageFile:C:\test\images\myimage.wim /index:1 /MountDir:C:\test\offline
Then?:
setup.exe /auto upgrade /installfrom C:\test\offline\win10_upgrade\sources\install.wim /dynamicupdate disable - brucegoose03 7 years ago
I used this link for the DISM commands. No matter if you've removed the apps previously, they will come back if they are in the new Builds .wim.
https://community.spiceworks.com/how_to/123554-removing-apps-from-windows-10-media
I then run the setup from a share:
"\\share01\Installs\Windows 10\setup.exe" /auto upgrade /installfrom "\\share01\Installs\Windows 10\sources\install.wim" /showoobe none /dynamicupdate disable - dugullett 7 years ago
Other managed installs like MS Office (setup.exe) work fine. Do you have any ideas? - TobiK 6 years ago
We´ve mount the iso. and zipped the contents. It is possible to start the upgrade when we manually unzip the downloaded content. Do you know if there is a size limit for unzipping dowloaded content? - TobiK 6 years ago
https://community.spiceworks.com/how_to/125905-change-esd-to-wim
Edit: I'm actually using method 1, not method 3. - WraithKnight80 6 years ago
I used Catalog Software option and every time I go to the installer page it freezes my KACE window for 5 minutes while it tries to load something on page. - rwt 5 years ago