Update OSD Task Sequence

In order to use OneSite as an Alternate Content Provider (ACP) in the WinPE phase of a ConfigMgr task sequence, the task sequence uses a task sequence variable to identify the location of OneSiteDownloader.exe. The name of the variable is SMSTSDownloadProgram. There are also other Task Sequence variables that can be added to configure settings for OneSite to use, see Task Sequence Variables.

There are two ways to implement the variable SMSTSDownloadProgram:

  • a variable within the task sequence itself,

  • or as a collection variable against the collection which contains the machines the task sequence will be targeted to.

Option 1 - Set a Task Sequence Variable

  1. Open your OSD task sequence by right-clicking and selecting Edit.

  2. In the left-hand navigation, under Install Operating System, select Apply Operating System task.

  3. Click Add > General > Set Task Sequence Variable and configure the following values:

    • Name: Set SMSTSDownloadProgram

    • Variable: SMSTSDownloadProgram

    • Value: %systemdrive%\OneSite\OneSiteDownloader.exe

      This is the location of the OneSiteDownloader relative to the root (X:) of your boot image.

You should also add the OneSiteServerNameOrIP variable to ensure that the OneSiteDownloader can communicate with the Adaptiva server to assist for P2P discovery.

  1. Click a second Task Sequence Variable and configure the following values:

    • Name: Set OneSiteServerNameOrIP

    • Variable: OneSiteServerNameOrIP

    • Value: The FQDN or IP address of the Adaptiva server.

Option 2 - Set a Collection Variable

  1. In the ConfigMgr console, navigate to Assets and Compliance > Device Collections > Operating System Deployment.

  2. In the details pane, right-click a device collection and click Properties.

  3. Select the Collection Variables tab and add a new variable:

    • Name: SMSTSDownloadProgram

    • Value: %systemdrive%\OneSite\OneSiteDownloader.exe

  4. Add a second variable name OneSiteServerNameOrIP to allow the OneSiteDownloader to communicate with the Adaptiva server to assist for P2P discovery.

    • Name: OneSiteServerNameOrIP

    • Value: <Adaptiva Server FQDN> OR <Adaptiva Server IP>

Modify the OSD Task Sequence

Copy the OneSiteDownloader to C

The OneSiteDownloader can be used in your task sequences after the WinPE section is completed and the build machine has been booted into Windows. Because the WinPE X: drive will no longer be available after booting into Windows, a task sequence step must be included to copy the OneSiteDownloader utility to the local C: drive.

  1. Open your OSD task sequence by right-clicking and selecting Edit.

  2. In the left-hand navigation, select Apply Operating System task and click Add > General > Run Command Line.

  3. Configure the Add the Run Command Line task with the following values:

    • Name: Copy OneSiteDownloader to C:

    • Command line: xcopy.exe %systemdrive%\OneSite C:\OneSite /y /s /i

Create OneSiteDownloader Firewall Rule

Once in the Windows environment, the Windows firewall may block OneSiteDownloader communication. After the Setup Windows and ConfigMgr task, a Run Command Line task should be added to open the Windows Firewall to OneSiteDownloader.

  1. In the left-hand navigation, under Setup Operating System, select Setup Windows and Configuration.

  2. Click Add > General > Run Command Line and configure the following values:

    • Name: OneSiteDownloader Firewall Rule

    • Command line: netsh advfirewall firewall add rule name=OSD dir=in action=allow program=%systemdrive%\OneSite\OneSiteDownloader.exe enable=yes

  3. Click the Options tab in the tasks sequence step.

  4. Click Continue on error. In some versions of WinPE this command may not be supported, so enable Continue on error.

  5. Since OneSiteDownloader was copied to the C: drive, the SMSTSDownloadProgram must be set again to point to the new location.

    • Add the task: Set Task Sequence Variable

    • Variable: SMSTSDownloadProgram

    • Value: %systemdrive%\OneSite\OneSiteDownloader.exe

Install the Adaptiva Client Package

OneSiteDownloader can't be used to download CI based content such as Software Updates or Applications, so before the Install Updates or any Install Application tasks, add an Install Package task to install the Adaptiva client.

  1. In the left-hand navigation, under Setup Operating System, select Setup Windows and Configuration.

  2. Click Add > General > Run Command Line and configure the following values:

    • Name: Install Adaptiva Client

    • Package: Adaptiva Client

    • Program: InstallOrUpgrade

  3. Click Add > General > Run PowerShell Script and configure the following values:

    • Name: Await Adaptiva Client License

    • PowerShell script:

    • Time-out (minutes): 15

    This PowerShell script will checkt that the Adaptiva Client has an ID and a license. If 15 minutes pass without a successful check, this task will fail.

  4. Close the task sequence.

Ensure Task Sequence is using the OneSite Boot Image

  1. Prior to deploying the task sequence, open the task sequence Properties, select the Advanced tab, then click the Browse button to select the OneSite Boot image created in the previous section.

At this point the Task Sequence is ready to be added to a content push policy. For additional options for OneSiteDownloader and task sequence variables, see OneSiteDownloader Task Sequence Variables.

Logging and Exit Codes

Whenever the OneSiteDownloader utility is executed, it creates a log file named OneSiteDownloader.LOG in the same folder where it was run. This also includes on the X: drive in WinPE.

Whenever the OneSiteDownloader tool is executed, it returns an exit code of 0 in case of success, and a non-zero WIN32 error code in case of failure. The cause of failure for any error may be determined by examining the OnesiteDownloader.LOG file and decoding the exit code using the Windows net helpmsg command.

For example, if a code 5 is returned, you can run the following command in a command prompt for more information: net helpmsg 5.

Last updated

Was this helpful?