Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Used to set the default wallpaper images for Windows 10 during MDT-integrated ConfigMgr OS deployment
# Get the TS variables
$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
$ScriptRoot = $tsenv.Value("ScriptRoot")
$OSDTargetSystemRoot = $tsenv.Value("OSDTargetSystemRoot")
# Rename default wallpaper
Rename-Item $OSDTargetSystemRoot\Web\Wallpaper\Windows\img0.jpg img1.jpg -Force
# Copy new default wallpaper
Copy-Item $ScriptRoot\img0.jpg $OSDTargetSystemRoot\Web\Wallpaper\Windows -Force
# Remove old wallpaper
Remove-Item $OSDTargetSystemRoot\Web\Wallpaper\Windows\img1.jpg -Force -Confirm:$false
# Define image file list
$Images = @(
'img0_1024x768.jpg'
'img0_1200x1920.jpg'
'img0_1366x768.jpg'
'img0_1600x2560.jpg'
'img0_2160x3840.jpg'
'img0_2560x1600.jpg'
'img0_3840x2160.jpg'
'img0_768x1024.jpg'
'img0_768x1366.jpg'
)
# Copy each 4K image
Foreach ($Image in $Images)
{
Copy-Item "$ScriptRoot\$Image" $OSDTargetSystemRoot\Web\4K\Wallpaper\Windows -Force
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.