Skip to content

Instantly share code, notes, and snippets.

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 = @(
# 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