Search This Blog

Thursday, April 15, 2021

OSDCloud - Image devices without need of infrastructure WIFI and ZTI

Introduction

OSDCloud is the most hyped tool I have yet seen in the community. Now does it live up to it.? YES indeed. We needed this kind of solution to simplify daily operations where we want a device fast up and running e.g., after repair of a broken hardware component. Now OSDCloud is not THE solution but PART of the solution.

This is a complete guide on how you can run OSD over WIFI and at the same time automate the whole process once it has been started.

IT TAKES 15 minutes to reinstall to a fully functional device

 

Requirements

 

Table of Content

  • Get newest OSDCloud
  • Get WinRE and inject your custom language
  • Create Github ZTI file
  • Inject drivers to WinRE

 

Get newest OSDCloud

Start powershell as elevated

Install-Module -Name OSD -force

clip_image002

 

Just making sure I am on the right version to continue with this post. You need at least this version or higher.

clip_image004

 

 

Get WinRE

New-OSDCloud.template -WinRE -Language da-dk -SetAllIntl da-dk -SetInputLocale da-dk -verbose

clip_image006

TIP: you can add more languages here by typing e.g. -Language da-dk,es-es,fr-fr

It really takes no time at all to create the workspace, it is just a copy of the Template from above.

New-OSDCloud.workspace -workspacepath C:\OSDCloud -Verbose

clip_image008

Create GitHub ZTI file

Now we would like to automate the whole process, so we don’t have to type anything once WIFI has been connected. For us not to rebuild the ISO or USB stick every time we want to change a simple thing in our Zero touch deployment file, we simply put the configuration online.

Go to your GitHub repository, dropbox or whatever online storage you have with access directly to your file.

Mine is here

This sample has been borrowed from David’s demo script

clip_image010

 

Copy these lines

Write-Host -ForegroundColor Green "Starting OSDCloud ZTI"

Start-Sleep -Seconds 5

#Change Display Resolution for Virtual Machine

if ((Get-MyComputerModel) -match 'Virtual') {

Write-Host -ForegroundColor Green "Setting Display Resolution to 1600x"

Set-DisRes 1600

}

#Make sure I have the latest OSD Content

Write-Host -ForegroundColor Green "Updating OSD PowerShell Module"

Install-Module OSD -Force

Write-Host -ForegroundColor Green "Importing OSD PowerShell Module"

Import-Module OSD -Force

#Start OSDCloud ZTI the RIGHT way

Write-Host -ForegroundColor Green "Start OSDCloud"

Start-OSDCloud -OSLanguage da-dk -OSBuild 20H2 -OSEdition Enterprise -ZTI

#Restart from WinPE

Write-Host -ForegroundColor Green "Restarting in 20 seconds!"

Start-Sleep -Seconds 20

wpeutil reboot

  

Add file

Create new file

clip_image012

 

Paste in the code you copied from this blog

Give the file a name like Win10-Enterprise-20H2-DA-DK.ps1 as this is what the configuration will deploy for you.

clip_image014

 

Commit the file

clip_image016

 

Enter the file

clip_image018

 

Click RAW

clip_image020

 

Copy the URL

clip_image022

 

 

Inject drivers, ZTI and custom wallpaper to WinRE

Now we need to make the changes to support both hardware WIFI and customizations like wallpaper and WebPSScript parameter.

Open elevated powershell

I have downloaded a wallpaper and added it to the workspace C:\OSDCloud. Created a folder called Wallpaper and placed it there.

In this line we will use the RAW URL copied earlier.

Edit-OSDCloud.winpe -workspacepath C:\OSDCloud -CloudDriver Dell,Wifi -WebPSScript https://raw.githubusercontent.com/mmelkersen/OSDCloud/main/Win10-Enterprise-21H2-DA-DK.ps1 -wallpaper "C:\OSDCloud\Wallpaper\wallpaper.jpg" -Verbose

clip_image024

Tip: you can also get more drivers into your WinRE image by typing -CloudDriver Dell,Nutanix,VMware,HP,Wifi and if you need custom that can be done too -DriverPath T:\Temp\WinPEDrivers. The more you put into it the bigger file you get.

 

Now it is time for us to test it. If you have a fairly new USB you can then run

New-OSDBoot.usb -workspacepath C:\OSDCloud

save-OSDCloud.usb

clip_image026

 

But I am not that lucky to possess such a thing

clip_image028

 

Instead, I will do this

New-OSDCloud.iso -workspacepath C:\OSDCloud

clip_image030

 

2 nicely build ISO files for us to use

clip_image032

 

To build my USB I use Rufus

Start Rufus

clip_image034

 

Make sure you have your USB attached in the device

Press Select

clip_image036

 

Choose OSDCloud.iso

clip_image038

 

Press Start

clip_image040

 

Press Ok

clip_image042

Once it is successfully, eject the USB and insert it into the device you need to image.

 

 

Booting your device

clip_image044

clip_image046

See a video of the process once in WinRE


Summary

No infrastructure. No cost. Evergreen all the way as:

  • The image is taken directly from Microsoft
  • The drivers are taken directly from vendor HP/Dell/Lenovo
  • The configuration is loaded from a cloud storage.

Use it together with Autopilot and you will have a nice clean environment with very little cost.

Happy Cloud OSD!

1 comment:

  1. Hi
    Great work. Is it possible to use image from usb? Its taking a lot of time to download from Microsoft

    ReplyDelete