Skip to content

Instantly share code, notes, and snippets.

@SMSAgentSoftware
Created July 6, 2017 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SMSAgentSoftware/a03f9129911059e26ae7a0fbeec8150a to your computer and use it in GitHub Desktop.
Save SMSAgentSoftware/a03f9129911059e26ae7a0fbeec8150a to your computer and use it in GitHub Desktop.
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