# MDT OSDCloud DriverPacks

This is a concept that is taken from the way OSDCloud downloads DriverPacks during the deployment in WinPE, rather than a traditional MDT Total Control or Modern Driver Management.  Implementing this requires no infrastructure other than open Internet access.  By implementing this concept, your MDT infrastructure will fully support 724 different Computer Models from Dell, HP , and Lenovo

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWwUf5oh2HveDM8e38a%2F-MWw_oVKgNwJ8uOahRog%2Fimage.png?alt=media\&token=4d56ed0e-f083-45ac-a729-cb46226f25ab)

## TODO

This process is currently in Development with the following items needing to be resolved

#### Logging

This function writes to a Transcript in C:\Drivers and will need to be expanded to logging in the BDD.log.  Reach out to me if you want to work on this

#### Proxy

Support for a Proxy has not been implemented yet, but is planned.  Reach out to me if you would like to contribute

#### Configuration Manager

This has not been tested in Configuration Manager at this time

## WinPE Requirements

PowerShell support is required for this to work, so at a minimum, you need to make sure that PowerShell is fully functional in WinPE

### Curl.exe

This is absolutely required for downloading the DriverPack.  If it is not in your WinPE, it will be sourced from your Offline OS.  If it is not in the OfflineOS, then it will exit out

{% hint style="danger" %}
In simple terms, if you are deploying an old OS that does not have $SystemRoot\System32\Curl.exe and you did not inject Curl.exe into WinPE at $MountDirectory\SystemRoot\System32\Curl.exe then you will not be able to download a DriverPack
{% endhint %}

### OSD PowerShell Module

The OSD Module will need to be added to your MDT Boot Image.  This is best handled by making sure your computer has the latest OSD Module and running the following commands

```
Import-Module OSD -Force

#The DeploymentShare needs to be local and writable as you are mounting a WIM
$DeploymentShare = "D:\DeploymentShare"

Copy-PSModuleToWim -Name OSD -ImagePath "$DeploymentShare\Boot\LiteTouchPE_x64.wim"
```

## Microsoft Deployment Toolkit

### Boot Images

After making sure you have added the OSD PowerShell Module to your LiteTouchPE\_x64.wim you will need to Update your Deployment Share

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWzSSoc4i54fQmYDBo6%2F-MWzSw2x3jO9GVCChy5o%2Fimage.png?alt=media\&token=75c61b66-f27a-45b3-b3de-86f0ea1fa830)

Make sure you do not completely regenerate your boot images

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWzSSoc4i54fQmYDBo6%2F-MWzT20v__f_x5J6qALd%2Fimage.png?alt=media\&token=cf14e2e3-a07a-410f-89bf-e186b0954c29)

You are good to go as long it uses the OSD enabled LiteTouchPE\_x64.wim.  If it pulls a new wim from the ADK, then let that complete, and add the OSD PowerShell Module to the LiteTouchPE\_x64.wim and repeat this process.

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWzSSoc4i54fQmYDBo6%2F-MWzTC-SV7Kvls2z4ylg%2Fimage.png?alt=media\&token=78afe970-1228-4c4d-9668-5cfa27e3c4f8)

### Unattend.xml Template

{% hint style="warning" %}
This step is not completely necessary if you plan on just editing an individual Task Sequence Unattend.xml
{% endhint %}

Edit the following file and add the XML snippet.  This is what expands the DriverPack in the Specialize Phase

```
"C:\Program Files\Microsoft Deployment Toolkit\Templates\Unattend_x64.xml.10.0"
```

```
<RunSynchronousCommand wcm:action="add">
    <Order>5</Order>
    <Description>Expand-ZTIDriverPack</Description>
    <Path>Powershell -ExecutionPolicy Bypass -Command Expand-ZTIDriverPack</Path>
</RunSynchronousCommand>
```

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWyrJ9wCWwcN3pOiEcC%2F-MWyrubK2xapUl7mSCwu%2Fimage.png?alt=media\&token=bf1dbda0-2f7a-4e8a-9b6e-a8ded0b22645)

### Task Sequence

You will need to add a Run Command Line step in your Postinstall group with the following configuration. **I strongly recommend to Continue on error**

**Command line:**

```
cmd.exe /c start /wait PowerShell.exe -ExecutionPolicy Bypass -Command Save-ZTIDriverPack
```

**Start in:**

```
%OSDisk%\Windows\System32
```

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWz3EOw38_V1WeOm7Os%2F-MWz3cpjvIQtwxD2PI1a%2Fimage.png?alt=media\&token=3d43077b-f7ef-4ec3-aded-b2eb49516543)

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWz3EOw38_V1WeOm7Os%2F-MWz3ipPwyB7Ch_VyWm-%2Fimage.png?alt=media\&token=142530ef-a038-464d-bc67-27a2441dde7d)

### Task Sequence Unattend.xml

Similar to the process detailed in the Unattend.xml Template section earlier, if you have an existing Task Sequence, you will need to edit the Unattend.xml file located in the following path

```
$DeploymentShare\Control\$TaskSequenceId\Unattend.xml
```

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWwPvCVPXFvf4MdgiZf%2F-MWwS65LVu9CyHHkE6yA%2Fimage.png?alt=media\&token=470b7fec-3388-4427-8f28-ff5b3b8e081c)

Add this snipped to your specialize settings pass.  Make sure that the Order Number is unique and next in line to the previous RunSynchronousCommand

```
<RunSynchronousCommand wcm:action="add">
    <Order>5</Order>
    <Description>Expand-ZTIDriverPack</Description>
    <Path>Powershell -ExecutionPolicy Bypass -Command Expand-ZTIDriverPack</Path>
</RunSynchronousCommand>
```

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWyvINISNzjqndIyeAi%2F-MWz2gb7pHuiY583SIE-%2Fimage.png?alt=media\&token=59c961c3-a651-45b8-8a60-8c9da9f576e7)

## Deployment

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWwSUsqmXiHDiRA0PUa%2F-MWwUHtRZkLe52acdda1%2Fimage.png?alt=media\&token=3aeaf66b-c131-4f7c-b214-2aad25ff6b0f)

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWz5zB7oP4qiWKbzK0T%2F-MWz6cQpZZLbHmZXiWAz%2Fimage.png?alt=media\&token=801fa5ea-8d71-4001-a7aa-3a11a0967923)

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWz5zB7oP4qiWKbzK0T%2F-MWz6oXA731CDRlZD8A-%2Fimage.png?alt=media\&token=48d507d9-32a3-4141-a005-749687150174)

### Save-ZTIDriverPack

This is the function that gets the OSDCloud Driver Pack and stages it in $OSDisk\Drivers.  It handles both a Copy if it exists in the DeploymentShare, or a Download if it does not.  The following is a brief summary of the actions

1. Connects to the MDT Task Sequence Environment (TSEnv)
2. Copies the OSD PowerShell Module from WinPE to the Offline OS
3. Identifies the required DriverPack using Get-MyDriverPack
4. Determines if the DriverPack is in $DeployRoot\DriverPacks
   1. True: Copy the DriverPack to $OSDisk\Drivers
   2. False
      1. Checks for curl.exe in WinPE
         1. False: Copy from $OSDisk\Windows\System32
      2. Downloads the DriverPack to $OSDisk\Drivers

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWz5zB7oP4qiWKbzK0T%2F-MWz7qZW9YvsUGuMNIyD%2Fimage.png?alt=media\&token=35ef49e6-a54a-4fd2-a43b-cb1e226bad43)

### Expand-ZTIDriverPack

During the Specialize phase, this function will scan all files in the root of C:\Drivers and expand them (if it can).  If it expands the DriverPack, it will also apply them to the Offline OS

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWz5zB7oP4qiWKbzK0T%2F-MWz83v4SLTeDJIxYaTJ%2Fimage.png?alt=media\&token=156a1128-47f4-407b-81d4-a6bf3dc1e440)

![](https://344220114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVSV22dcsjKDdOxDA6n%2F-MWwSUsqmXiHDiRA0PUa%2F-MWwSgLWiZ3Yv2Mt8Ua_%2Fimage.png?alt=media\&token=a3b45c51-c369-4b4c-b748-8f31c1b2346e)

{% embed url="<https://youtu.be/MfWA1tJpMM4>" %}
