Update setupMDT.ps1

cleanup
This commit is contained in:
Upgrayedd 2024-08-18 02:41:04 -05:00
parent 7680545b23
commit 0fd9c4ef03

View file

@ -1,30 +1,32 @@
#https://www.dannymoran.com/deploy-windows-11-with-mdt-and-wds/ #https://www.dannymoran.com/deploy-windows-11-with-mdt-and-wds/
#Thank you Danny <3 #Thank you Danny <3
#need WDS for like 2 pieces
Install-WindowsFeature WDS Install-WindowsFeature WDS
#dlownload and install MDT
Start-BitsTransfer "https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi" \\SynCloud\Data\Resources\MDTx64.msi Start-BitsTransfer "https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi" \\SynCloud\Data\Resources\MDTx64.msi
msiexec /i \\SynCloud\Data\Resources\MDTx64.msi /qn msiexec /i \\SynCloud\Data\Resources\MDTx64.msi /qn
#download the Assessment and Deployment Kit, and WinPE add-on
Start-BitsTransfer "https://download.microsoft.com/download/6/7/4/674ec7db-7c89-4f2b-8363-689055c2b430/adk/adksetup.exe" \\SynCloud\Data\Resources\adksetup.exe Start-BitsTransfer "https://download.microsoft.com/download/6/7/4/674ec7db-7c89-4f2b-8363-689055c2b430/adk/adksetup.exe" \\SynCloud\Data\Resources\adksetup.exe
Start-BitsTransfer "https://download.microsoft.com/download/3/c/2/3c2b23b2-96a0-452c-b9fd-6df72266e335/adkwinpeaddons/adkwinpesetup.exe" \\SynCloud\Data\Resources\adkwinpesetup.exe Start-BitsTransfer "https://download.microsoft.com/download/3/c/2/3c2b23b2-96a0-452c-b9fd-6df72266e335/adkwinpeaddons/adkwinpesetup.exe" \\SynCloud\Data\Resources\adkwinpesetup.exe
#install them to a NOT C:\ location
cmd /c \\SynCloud\Data\Resources\adksetup.exe /features + /q /installpath "T:\WinADK" cmd /c \\SynCloud\Data\Resources\adksetup.exe /features + /q /installpath "T:\WinADK"
cmd /c \\SynCloud\Data\Resources\adkwinpesetup.exe /features + /q /installpath "T:\WinADK" cmd /c \\SynCloud\Data\Resources\adkwinpesetup.exe /features + /q /installpath "T:\WinADK"
Add-PSSnapIn Microsoft.BDD.PSSnapIn Add-PSSnapIn Microsoft.BDD.PSSnapIn
Import-Module 'C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1'
mkdir T:\DeploymentShare mkdir T:\DeploymentShare
#new-PSDrive -Name "MDT" -PSProvider "MDTProvider" -Root "T:\DeploymentShare" -Description "MDT Deployment Share" -NetworkPath "\\ema\DeploymentShare$" -Verbose | add-MDTPersistentDrive -Verbose #import the module
#import-mdtoperatingsystem -path "MDT:\Operating Systems" -SourcePath "T:\Deploymentshare\Operating Systems\Windows 7 x64" -DestinationFolder "Windows 7 x64" -Verbose Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
#import-mdtdriver -path "MDT:\Out-of-Box Drivers" -SourcePath "T:\Drivers" -ImportDuplicates -Verbose
#update-MDTDeploymentShare -path "MDT:" -Verbose #mount the Deployment Share
#import-mdtoperatingsystem -path "MDT:\Operating Systems" -SourcePath "T:\Deploymentshare\Operating Systems\Windows 7 x64" -DestinationFolder "Windows 7 x64" -Verbose New-PSDrive -Name "DS001" -PSProvider MDTProvider -Root "T:\DeploymentShare"
#
#add Operating System Folder #add Operating System Folder
Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
New-PSDrive -Name "DS001" -PSProvider MDTProvider -Root "T:\DeploymentShare"
new-item -path "DS001:\Operating Systems" -enable "True" -Name "Windows10auto" -Comments "For Old People" -ItemType "folder" -Verbose new-item -path "DS001:\Operating Systems" -enable "True" -Name "Windows10auto" -Comments "For Old People" -ItemType "folder" -Verbose
#mount the windows ISO #mount the windows ISO
@ -33,7 +35,6 @@ $Drive = ($info | get-volume)
$Source = $Drive.DriveLetter+":\" $Source = $Drive.DriveLetter+":\"
#import OS #import OS
Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
import-mdtoperatingsystem -path "DS001:\Operating Systems\Windows10auto" -SourcePath $Source -DestinationFolder "Windows 10 x64 auto" -Verbose import-mdtoperatingsystem -path "DS001:\Operating Systems\Windows10auto" -SourcePath $Source -DestinationFolder "Windows 10 x64 auto" -Verbose
#unmount the ISO #unmount the ISO
@ -47,7 +48,11 @@ Start-BitsTransfer "https://downloads.dell.com/FOLDER08644749M/1/3070-0DFFN_Win1
cmd /c \\SynCloud\Data\Resources\Dell\Driver\3070\3070-0DFFN_Win10_1.0_A09.exe /s /e=\\SynCloud\Data\Resources\Dell\Driver\3070\ cmd /c \\SynCloud\Data\Resources\Dell\Driver\3070\3070-0DFFN_Win10_1.0_A09.exe /s /e=\\SynCloud\Data\Resources\Dell\Driver\3070\
#^that takes a while, consider doing it locally #^that takes a while, consider doing it locally
#for virtio proxmox drivers #install the drivers to Out-of-Box DeploymentShare
new-item -path "DS001:\Out-of-Box Drivers" -enable "True" -Name "Optiplex3070" -Comments "Put em in a folder ya Dingus" -ItemType "folder" -Verbose
import-mdtdriver -path "DS001:\Out-of-Box Drivers\Optiplex3070" -SourcePath "\\SynCloud\Data\Resources\Dell\Driver\3070\3070" -ImportDuplicates -Verbose
#all together now, for virtio proxmox drivers
$info = Mount-DiskImage -ImagePath "\\SynCloud\Data\Resources\virtio-win-0.1.262.iso" $info = Mount-DiskImage -ImagePath "\\SynCloud\Data\Resources\virtio-win-0.1.262.iso"
$Drive = ($info | get-volume) $Drive = ($info | get-volume)
$Source = $Drive.DriveLetter+":\" $Source = $Drive.DriveLetter+":\"
@ -55,13 +60,10 @@ new-item -path "DS001:\Out-of-Box Drivers" -enable "True" -Name "Virtio" -Commen
import-mdtdriver -path "DS001:\Out-of-Box Drivers\Virtio" -SourcePath $Source -ImportDuplicates -Verbose import-mdtdriver -path "DS001:\Out-of-Box Drivers\Virtio" -SourcePath $Source -ImportDuplicates -Verbose
Dismount-DiskImage -ImagePath "\\SynCloud\Data\Resources\virtio-win-0.1.262.iso" Dismount-DiskImage -ImagePath "\\SynCloud\Data\Resources\virtio-win-0.1.262.iso"
#install the drivers to Out-of-Box DeploymentShare
new-item -path "DS001:\Out-of-Box Drivers" -enable "True" -Name "Optiplex3070" -Comments "Put em in a folder ya Dingus" -ItemType "folder" -Verbose
import-mdtdriver -path "DS001:\Out-of-Box Drivers\Optiplex3070" -SourcePath "\\SynCloud\Data\Resources\Dell\Driver\3070\3070" -ImportDuplicates -Verbose
#make the Task Sequence #make the Task Sequence
import-mdttasksequence -path "DS001:\Task Sequences" -Name "Windows 10 Pro x64" -Template "Client.xml" -Comments "Here we go" -ID "Win10Pro" -Version "1.0" -OperatingSystemPath "DS001:\Operating Systems\Windows10\Windows 10 Pro in Windows 10 x64 install.wim" -FullName "MDT User" -OrgName "UG" -HomePage "about:blank" -Verbose import-mdttasksequence -path "DS001:\Task Sequences" -Name "Windows 10 Pro x64" -Template "Client.xml" -Comments "Here we go" -ID "Win10Pro" -Version "1.0" -OperatingSystemPath "DS001:\Operating Systems\Windows10\Windows 10 Pro in Windows 10 x64 install.wim" -FullName "MDT User" -OrgName "UG" -HomePage "about:blank" -Verbose
#Go do the INI updates manually (sad) #Go do the INI updates and properties manually (sad)
#Update the deployment share #Update the deployment share
update-MDTDeploymentShare -path "DS001:" -Force -Verbose update-MDTDeploymentShare -path "DS001:" -Force -Verbose