- Download repo as zip and extract into 'workspace' directory
- Import wimauto module
- Install WSUS
- Run
Install-WSUS -WsusRepoDirectory "$workspacePath\updaterepo" -UpdateLanguageCode "en"
- This will take some time to fully complete due to the initial sync (will take a LONG time)
- There is an option to install WSUS as part of the 'Invoke-BuildUpdate' wrapper function, but I don't recommend using it since it's a single-run process - it's mostly there as a template
- Run Set-WsusConfiguration
- Run Set-EnabledProductUpdateApproval
- This will take some time as it gathers the product updates and filters them
- Run
- Download desired Windows ISO and copy into the workspace directory
- To obtain oscdimg.exe
- Download WADK
- Select only 'Deployment Tools' feature to install
- Either copy the exe to workspace, and/or update path in build params ($isoSettings.OscdimgPath)
- Download WADK
- Modify the updateWim.ps1 wrapper script as necessary
- Update workspace variable and ensure Server Version is set to desired version
- Ensure the path to the wimauto module files is correct
- Update the buildParams variable as necessary
- ImageIndex attribute controls which version of the OS to install (e.g. Standard vs Datacenter)
- Update OscdimgPath in isoSettings variable if necessary
- Update the options as necessary
- Typically only need to copy the wim from the ISO once, then set this to false
- Should leave InjectAnswerFiles on true at least once so the correct license is injected into the auto/unattend.xml files
- Update server version build Params as necessary
- Update the IsoPath to the correct file path to the downloaded OS Source ISO
- Feel free to strip out the 2012 stuff - I've left it in just in case
Passwords in unattend files are encoded in base64 with 'Password' and 'AdministratorPassword' appended to the password string
- P@ssw0rd123 <-- OG PW
- UABAAHMAcwB3ADAAcgBkADEAMgAzAFAAYQBzAHMAdwBvAHIAZAA= <-- Base64 encoding in unattend.xml 'AutoLogon | Password' value
- P@ssw0rd123Password
- UABAAHMAcwB3ADAAcgBkADEAMgAzAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA== <-- Base64 encoding in unattend.xml 'UserAccounts | AdministratorPassword' value
- P@ssw0rd123AdministratorPassword
$encryptedText = 'UABAAHMAcwB3ADAAcgBkADEAMgAzAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA=='
Write-Host 'Decoded Admin Password'
[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($encryptedText))
$adminPasswordText = 'P@ssw0rd123AdministratorPassword'
Write-Host 'Base64 encoded Admin Password'
[System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes(($adminPasswordText)))
To offload the ISO/VHD from an Azure VM:
Connect-AzAccount -Environment $azureEnvironment
$sa=Get-AzStorageAccount -ResourceGroupName $saRG -Name $saName
Set-AzStorageBlobContent -File $pathToFile -Container $containerName -Context $sa.Context