##-------------------------------------------------------------------------------------------------------------- ## Script for slipstreaming drivers to a windows install iso ## ## Prereq. - Download the Windows ADK for windows 10, install only the Deployment tools and Windows PE ! ## - Download the latest version of Windows ISO ## - Download the drivers to slipstream ## - Run this script as administrator! ## - Set the variables before running script ## ## Copyright Bart Michel ## Date: 12-07-2018 ##-------------------------------------------------------------------------------------------------------------- ## Location of Downloaded files $IsoLocation = "C:\Temp\SW_DVD9_Win_Server_STD_CORE_2016_64Bit_English_-4_DC_STD_MLF_X21-70526.ISO" $DriverLocation = "C:\Temp\Drivers" $Bootorder = "C:\Slipstream\BootOrder.txt" ## Location of directories $ExportedISOLocation = "C:\Slipstream\WindowsISO" $ExportedDriverLocation = "C:\Slipstream\Drivers" $SlipstreamDir = "C:\Slipstream" $SourcesDir = "C:\Slipstream\WindowsISO\sources" $MountDir = "C:\Slipstream\Mount" $oscdimg = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" $etfsboot = "C:\Slipstream\WindowsISO\boot\etfsboot.com" $efisys = "C:\Slipstream\WindowsISO\efi\microsoft\boot\efisys.bin" $new = "C:\Slipstream\FinishedISO\Windows2016-UCSdrivers.iso" $FinishedISOLocation = "C:\Slipstream\FinishedISO\" $LogDir = "C:\temp\log.txt" ## Create working dir MD C:\Slipstream MD C:\Slipstream\Drivers MD C:\Slipstream\FinishedISO MD C:\Slipstream\Mount MD C:\Slipstream\WindowsISO ## Copy Windows ISO to WindowsISO directory $mountResult = Mount-DiskImage $IsoLocation -StorageType ISO -PassThru $driveLetter = ($mountResult | Get-Volume).DriveLetter $driveletter $sourceWinISO = $driveletter +":\*" Copy-Item -Path $sourceWinISO -Destination $ExportedISOLocation -Recurse -Verbose ## Copy Drivers to slipstream Drivers directory Copy-Item -Path $DriverLocation\* -Destination $ExportedDriverLocation -Recurse -Verbose ## Create Bootorder.txt in slipstream directory Add-Content $Bootorder "`nboot\bcd`r`nboot\boot.sdi`r`nboot\bootfix.bin`r`nboot\bootsect.exe`r`nboot\etfsboot.com`r`nboot\memtest.exe`r`nboot\en-us\bootsect.exe.mui`r`nboot\fonts\chs_boot.ttf`r`nboot\fonts\cht_boot.ttf`r`nboot\fonts\jpn_boot.ttf`r`nboot\fonts\kor_boot.ttf`r`nboot\fonts\wgl4_boot.ttf`r`nefi\boot\bootx64.efi`r`nefi\microsoft\boot\bcd`r`nefi\microsoft\boot\cdboot.efi`r`nefi\microsoft\boot\cdboot_noprompt.efi`r`nefi\microsoft\boot\efisys.bin`r`nefi\microsoft\boot\efisys_noprompt.bin`r`nefi\microsoft\boot\memtest.efi`r`nefi\microsoft\boot\fonts\chs_boot.ttf`r`nefi\microsoft\boot\fonts\cht_boot.ttf`r`nefi\microsoft\boot\fonts\jpn_boot.ttf`r`nefi\microsoft\boot\fonts\kor_boot.ttf`r`nefi\microsoft\boot\fonts\wgl4_boot.ttf`r`nsources\boot.wim" ## Reomving read-only attribute of Wim files Set-ItemProperty $SourcesDir\boot.wim -name IsReadOnly -value $false Set-ItemProperty $SourcesDir\install.wim -name IsReadOnly -value $false ## Inject Drivers in Bootwin file Dism /Mount-Image /ImageFile:$SourcesDir\boot.wim /index:1 /MountDir:$SlipstreamDir\Mount Dism /Image:$SlipstreamDir\Mount /Add-Driver /Driver:$SlipstreamDir\Drivers /Recurse Dism /Unmount-Wim /Mountdir:$SlipstreamDir\Mount /Commit Dism /Mount-Image /ImageFile:$SourcesDir\boot.wim /index:2 /MountDir:$SlipstreamDir\Mount Dism /Image:$SlipstreamDir\Mount /Add-Driver /Driver:$SlipstreamDir\Drivers /Recurse Dism /Unmount-Wim /Mountdir:$SlipstreamDir\Mount /Commit ## Inject Drivers in Install Wil file Dism /Mount-Image /ImageFile:$SourcesDir\install.wim /index:1 /MountDir:$SlipstreamDir\Mount Dism /Image:$SlipstreamDir\Mount /Add-Driver /Driver:$SlipstreamDir\Drivers /Recurse Dism /Unmount-Wim /Mountdir:$SlipstreamDir\Mount /Commit Dism /Mount-Image /ImageFile:$SourcesDir\install.wim /index:2 /MountDir:$SlipstreamDir\Mount Dism /Image:$SlipstreamDir\Mount /Add-Driver /Driver:$SlipstreamDir\Drivers /Recurse Dism /Unmount-Wim /Mountdir:$SlipstreamDir\Mount /Commit Dism /Mount-Image /ImageFile:$SourcesDir\install.wim /index:3 /MountDir:$SlipstreamDir\Mount Dism /Image:$SlipstreamDir\Mount /Add-Driver /Driver:$SlipstreamDir\Drivers /Recurse Dism /Unmount-Wim /Mountdir:$SlipstreamDir\Mount /Commit Dism /Mount-Image /ImageFile:$SourcesDir\install.wim /index:4 /MountDir:$SlipstreamDir\Mount Dism /Image:$SlipstreamDir\Mount /Add-Driver /Driver:$SlipstreamDir\Drivers /Recurse Dism /Unmount-Wim /Mountdir:$SlipstreamDir\Mount /Commit # Create the updated iso. $data = '2#p0,e,b"{0}"#pEF,e,b"{1}"' -f $etfsboot, $efisys start-process $oscdimg -args @("-bootdata:$data",'-u2','-m','-o','-udfver102', $ExportedISOLocation, $new) -wait -nonewwindow ## Cleaning up Dismount-DiskImage -ImagePath $IsoLocation RD $SlipstreamDir\Drivers -Recurse -Force RD $SlipstreamDir\WindowsISO -Recurse -Force RD $SlipstreamDir\Mount -Recurse -Force del $SlipstreamDir\BootOrder.txt ## Open File explorer ISO Location ii -Path $FinishedISOLocation ## Console output to log and open $psise.CurrentPowerShellTab.ConsolePane.Text | Set-Content -Path $LogDir ii -Path $LogDir Download Script Slipstream.ps1
Labels
Azure
(1)
Backup
(1)
Backup Exec 2010
(1)
Certificaten
(2)
Citrix
(3)
counters
(1)
CSV
(2)
dirsync
(1)
DNS
(1)
DPM 2012
(4)
Exchange
(2)
Exchange 2012
(2)
Failover Cluster
(6)
Flashplayer
(1)
Gateway
(1)
GPO
(1)
Hyper-V
(7)
Internet explorer
(1)
Java
(1)
Microsoft
(27)
Netscaler
(1)
Office 365
(2)
OWA
(1)
performance
(1)
policy
(1)
Powershell
(4)
SCVMM
(1)
SHA2
(1)
snapshot
(1)
Sp2
(1)
sql
(1)
Sydi
(1)
Symantec
(1)
Terminal server
(1)
Time
(1)
TMG
(2)
Tools
(1)
UAG
(3)
update
(1)
VHD
(1)
Windows 7
(3)
Windows server 2003
(1)
Windows Server 2008
(11)
windows server 2012
(3)
Windows server 2016
(1)
WMI
(2)
maandag 16 juli 2018
How to slipstream a Windows ISO
Abonneren op:
Posts (Atom)