/build/static/layout/Breadcrumb_cap_w.png

KACE SMA - Windows 10 Preseeding large files (OUTDATED- PLEASE USE BUILT-IN FEATURE)

Hello Community,

Here comes my second article in my mini series for all of you who are also facing a Windows 10 inplace upgrade strategy. This series will contain 3 blog post which will contain

1.) a precheck to detect upgrade issues or blocker in advance

      https://www.itninja.com/blog/view/kace-sma-windows-10-inplace-upgrade-precheck

2.) the preseeding of the binaries so that clients outside your network will smoothly download the gigabytes

3.) the upgrade itself

      https://www.itninja.com/blog/view/kace-sma-windows-10-inplace-upgrade


Again I will thank chrpetri for the development and testing of this scripts.


This script is intended to help distribute the Windows 10 ISO file to clients that are not available on the internal network.

Here you can download the exported script as well as the custom inventory rule (CIR).

DOWNLOAD

 

This script uses the Microsoft BITS client in the background. This client is also used for Outlook synchronization. For detailed information about the client, please visit the following page:

https://docs.microsoft.com/en-us/windows/win32/bits/background-intelligent-transfer-service-portal

BITS is very robust and allows multiple network changes without the cancellation of the download task. Since we wanted to keep the script simple, we have created a “BITSget.exe” in which an intelligence is built in and allows us to use parameters within our script. BITS is always executed in a mode that uses the lowest bandwidth. This is intended to prevent the complete ISO file from being downloaded during a mobile data connection and the data volume from being used up.

There is also a self-developed “CheckFileHash.exe”. We need this file to check whether the file has been downloaded completely so that it can be unpacked afterwards.

There are three tasks in the script itself. The first task only looks to see if the $KACE.Cache folder exists and, if not, creates it. This folder is hidden so that users do not use the installation data elsewhere.

Task two executes the “BITSget.exe”.

In this you must enter the URL to your webserver as well as the hash value of the file.

I unpacked the Windows 10 1903 ISO file and repacked it as a ZIP file. This allows us to unpack the files after checking the hash value after the download. You can determine the hash value with the help of the "checkfilehash.exe", which can be found in the dependencies of this script. Below is an example of the command:

CheckFileHash.exe SHA1 C:\temp\WinX1903.zip

If you have read the hash value of the ZIP file, you can change it in the script.


In the third task we check with the help of the "checkfilehash.exe" whether the file was downloaded completely. If not, a file will be created that the download is not yet complete. This file will be interpreted by SMA with the attached CIR. With that CIR we will have the latest information in our report. There is also another CIR that reads the current task of BITS so we can monitor the status and progress of the download.

You have to modify the hash value in this line the same way you did before.



Once the file has been successfully downloaded and unpacked, the status is logged and read with the CIR.


Note: The ID of the CIR is stored in the report, which is probably different for you.

The report must be adjusted. Navigate to "Reporting" and search for "Windows 10 PreSeeding status". After a click on the report, you can click on "Fields to Display". Here you must choose the CIRs.


Now you can click on "Sort and Breaks" and choose the CIR "Inventory: Windows 10 PreSeeding status" and set it as Break Header.


After that, you can click on "Filters". You have to edit the filter and choose the "Inventory: Windows 10 PreSeeding status" and set the operator to "is NOT NULL".


Now you can save the filter and the report.


The following is an example of what the report could look like.

 

This script could be also used for other, large packages and is not only intended for the download of a Windows 10 ISO (zip) file.

I hope this article helps you with your Windows 10 migration strategy. If there are any questions or problems, do not hesitate to use the comment function and let me know.


Comments

  • Hi,

    Are there any dependencies with .NET 3.5 with this script? I seem to be getting a prompt for .NET 3.5 when its run against a test system.


    Thanks in advance.

    Paul - MWPA_PB 1 year ago
    • Yes, the BITSget.exe requires an installed .NET Framework 3.5.
      I'm currently working on a new release that relies on .NET Framework 4, but it will take some time, I fear. - chrpetri 1 year ago
  • I see the "checkfilehash.exe" in the dependencies of the "WinX 1909 PRESEEDING" script, but do not know how to extract it so I can run "CheckFileHash.exe" against my WinX_1909.zip file?
    Do I need to use a webserver for my clients to download the WinX_1909.zip file?
    Can I use a UNC path for the clients on my internal network?
    Plus, I do not see the "Inventory Windows 10 BITS Job status" Custom Field? - Shock 1 year ago
    • Hi,

      first of all happy new year.

      Regarding the CheckFileHash.exe. You can simply click on the dependency and then download it to your desktop. If that not works, you can right click on the dependency and choose "Save link as".

      For the WinX_1909.zip file you need a webserver, because BITS can not handle an UNC path. If you do not have a webserver in your environment, you can use the SMA for that.

      You can upload your ZIP file as "Software" and after that you can go into the Software and then you can right click on the link to your ZIP file and choose "Copy link address". You can use this address in my script as webserver_url. If that do not work, you need to check your settings. In "Settings / Control Panel / Security Settings" you must completely scroll down and there is a checkbox for "Secure Service Desk attachments". You must uncheck this checkbox and then you can download your file from the SMA.

      But take care. This is not recommended. An own webserver for that is the best solution because if you have to many clients that will download the ZIP file it causes errors on the appliance maybe.

      Regarding the BITS Job Status. It is weird. Normally it should be included in my exported files. Here is the custom inventory command line for this field:

      ShellCommandTextReturn(cmd /c powershell.exe -command "Get-BitsTransfer -AllUsers |fl")

      Hope that helps you. - sven.hain 1 year ago
  • Hello Sven.hain,
    First of all, great articles and thank you so much for sharing with us.
    We have a few remote devices which connect to KACE SMA through VPN. We don't have a web server to host ISO for the remote clients. So, I was thinking if the upgrade script will work for the clients who connects through VPN?
    Secondly, your actual upgrade script points to the local file share [Launch “$(KACE_DEPENDENCY_DIR)\UpgradeWinX.cmd” with params “\\192.168.50.1\install$\WinX1909\ C:\WinX1909”]
    So if devices will download the ISO by using this preseeding script, we can skip this part in the upgrade script? - tahirebi 1 year ago
    • Good morning,

      thanks a lot for the feedback.

      If you don´t have a web server for the ISO it is not a big problem. If the clients are connected via VPN, you can alternatively use the file synchronisation of the SMA. It is located in "Distribution". With that you can sync the ISO to the remote clients as well and then you can run the upgrade locally.

      The answer for your second question is no, you can´t skip the part where you launch the upgrade script. You need to launch it with the local path of the extracted ISO file. For example:

      [Launch “$(KACE_DEPENDENCY_DIR)\UpgradeWinX.cmd” with params “C:\temp\WinX1909\ C:\WinX1909”]

      With this parameter we know where the ISO is located and then the upgrade script can be executed.

      Hope that helps you and have a great start into the week. - sven.hain 1 year ago
      • Thank you so much.
        So, I assume I need to extract the ISO file to C:\temp\WinX1909\ (or any other location on the client device) by using file synchronization before running the upgrade script?
        But where ever I extract the file, I need to include the location in the upgrade script? - tahirebi 1 year ago
      • That is absolutely right :) - sven.hain 1 year ago
This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ