Setting the Default Wallpaper for Windows 10 during ConfigMgr OSD

So finally I got around to doing some Windows 10 deployments (better late than never :)) and I wanted to set the default wallpaper during Operating System deployment with Configuration Manager. I’ve seen a few posts out there about how to do that, but they all run during the OS phase of the deployment, which means you have to take ownership and set permissions on all the image files. However,  you can bypass those permission changes by setting the wallpaper during the WinPE phase of the deployment instead.

I wrote a post about that before, but it was only tested on Windows 7. In Windows 10, the process has changed a bit. In addition to the \Windows\Web\Wallpaper\Windows directory that contains the “img0.jpg” default wallpaper image, there is now also a \Windows\Web\4K\Wallpaper\Windows directory, which contains images of various resolutions. It seems that if the screen resolution is set to the resolution of one of the images in the 4K directory, it will use that one as the default.

This means that we need to provide image files of equivalent resolutions in this directory as well as the standard wallpaper directory. The following image files and resolutions are required:


The “img0.jpg” image file can be around 1920×1200 to match the default size.

Since I am using MDT-integrated ConfigMgr (and you are too, right?!), I’m simply going to place all these image files in the Scripts directory in my MDT toolkit package, together with the following PowerShell script which will replace the existing image files with the new ones.

# 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

If you are using standalone ConfigMgr, then you will need to create a package containing the image files and PowerShell script, scrap the TS variable section at the top of the script, and change the variables used:

$ScriptRoot > $PSScriptRoot

$OSDTargetSystemRoot > $env:windir

After updating the MDT toolkit package to my distribution points (or distributing the package for standalone ConfigMgr), I can add a step to my OSD task sequence to run a PowerShell script. For MDT-integrated, I can use the MDT step Run PowerShell Script:


If standalone ConfigMgr, I can use the ConfigMgr step Run PowerShell Script and reference the package:


I am adding this step during the Post Install phase, just after laying the OS image on the disk.  At this point, we are still in WinPE, so we are not changing the online OS and therefore no permission changes are required.

And that’s it!  Now all the default wallpaper images will be replaced with my custom ones.  The beauty of doing this during OSD is that the end user can still change the default image if he wants to. If you prefer to lock the default wallpaper, then consider using group policy instead.

7 thoughts on “Setting the Default Wallpaper for Windows 10 during ConfigMgr OSD

  1. So, I’m not using SCCM, just MDT. What do I need to change on your script to get it to work with just MDT?

    1. I haven’t tried it with standalone MDT unfortunately. I assume that it would work if you run it in the Postinstall phase before the reboot. You would need to change the OSDTargetSystemRoot variable to something like:
      $OSDTargetSystemRoot = “$($tsenv.Value(“OSDisk”))” + “\Windows”

  2. Hi Trevor,
    I am using MDT 2013 update 2 and trying to customize the wallpaper in my Win10 1703 image.
    Just tried your PS script with amending the OSDTargetSystemRoot you provided above.
    There are no error at the end of the process and I can see the jpg files have been replaced as expected in the target machine.
    However the default Win10 wallpaper remains the same even if I create a new user.
    Anything else to be done to make it fully work ?

  3. Copy-Item : Could not find a part of the path ‘X:\WINDOWS\Web\Wallpaper\Windows’ error while running the SCCM based TS. Task has been added during the WinPE mode

  4. This does not work with Windows 10 x64 since $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment won’t be able to run in WinPE x64. COMObject Microsoft.SMS.TSEnvironment is great if you use only x86 WinPE and x86 Windows.

    Things get ugly on x64 Windows/SCCM 2012 Client x64 with COMObject Microsoft.SMS.TSEnvironment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.